[Piglit] [PATCH] arb_sample_shading: document automatic per-sample FS execution

Brian Paul brianp at vmware.com
Thu Jul 27 17:56:04 UTC 2017


Explain why these tests don't need to enable GL_SAMPLE_SHADING_ARB.
---
 .../arb_sample_shading/execution/builtin-gl-sample-id.cpp     | 11 +++++++++++
 .../execution/builtin-gl-sample-position.cpp                  | 11 +++++++++++
 2 files changed, 22 insertions(+)

diff --git a/tests/spec/arb_sample_shading/execution/builtin-gl-sample-id.cpp b/tests/spec/arb_sample_shading/execution/builtin-gl-sample-id.cpp
index c318b14..5ccef90 100644
--- a/tests/spec/arb_sample_shading/execution/builtin-gl-sample-id.cpp
+++ b/tests/spec/arb_sample_shading/execution/builtin-gl-sample-id.cpp
@@ -25,6 +25,17 @@
  *  This test verifies that using gl_SampleID in fragment shader program
  *  works as per ARB_sample_shading specification.
  *
+ *  Note that we do not have to enable GL_SAMPLE_SHADING_ARB.
+ *  The GL_ARB_sample_shading spec (and the GLSL 4.0 spec) say:
+ *
+ *      9) Is per-sample shading ever triggered by properties of the fragment
+ *      shader?
+ *
+ *      RESOLVED:  Yes.  The variables "gl_SampleID" and "gl_SamplePosition"
+ *      can be used to read properties of the current sample, which wouldn't
+ *      make much sense if the fragment shader were run at a lower frequency
+ *      than per-sample.
+ *
  **/
 
 #include "piglit-fbo.h"
diff --git a/tests/spec/arb_sample_shading/execution/builtin-gl-sample-position.cpp b/tests/spec/arb_sample_shading/execution/builtin-gl-sample-position.cpp
index ede6514..88a6c5f 100644
--- a/tests/spec/arb_sample_shading/execution/builtin-gl-sample-position.cpp
+++ b/tests/spec/arb_sample_shading/execution/builtin-gl-sample-position.cpp
@@ -25,6 +25,17 @@
  *  This test verifies that using gl_SamplePosition in fragment shader
  *  program works as per ARB_sample_shading specification.
  *
+ *  Note that we do not have to enable GL_SAMPLE_SHADING_ARB.
+ *  The GL_ARB_sample_shading spec (and the GLSL 4.0 spec) say:
+ *
+ *      9) Is per-sample shading ever triggered by properties of the fragment
+ *      shader?
+ *
+ *      RESOLVED:  Yes.  The variables "gl_SampleID" and "gl_SamplePosition"
+ *      can be used to read properties of the current sample, which wouldn't
+ *      make much sense if the fragment shader were run at a lower frequency
+ *      than per-sample.
+ *
  **/
 
 #include "piglit-fbo.h"
-- 
1.9.1



More information about the Piglit mailing list