[v2] glsl-es-3.10: add a test for helper invocations

Submitted by Ilia Mirkin on Nov. 12, 2015, 8:40 p.m.

Details

Message ID 1447360831-26277-1-git-send-email-imirkin@alum.mit.edu
State New
Headers show
Series "glsl-es-3.10: add a test for helper invocations" ( rev: 2 ) in Piglit

Not browsing as part of any series.

Commit Message

Ilia Mirkin Nov. 12, 2015, 8:40 p.m.
Tested on my nouveau implementation. Based on a suggestion from GlennK.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
---

v1 -> v2: use abs, per glennk

 .../execution/helper-invocation.shader_test        | 27 ++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 tests/spec/glsl-es-3.10/execution/helper-invocation.shader_test

Patch hide | download patch | download mbox

diff --git a/tests/spec/glsl-es-3.10/execution/helper-invocation.shader_test b/tests/spec/glsl-es-3.10/execution/helper-invocation.shader_test
new file mode 100644
index 0000000..07ed5a0
--- /dev/null
+++ b/tests/spec/glsl-es-3.10/execution/helper-invocation.shader_test
@@ -0,0 +1,27 @@ 
+[require]
+GL ES >= 3.1
+GLSL ES >= 3.10
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 310 es
+precision highp float;
+out vec4 color;
+void main() {
+  float helper = float(gl_HelperInvocation);
+  color = vec4(abs(dFdx(helper)), abs(dFdy(helper)), 0, 1);
+}
+
+[test]
+clear color 0.2 0.2 0.2 0.2
+clear
+
+# A single pixel being drawn, guaranteed that both the X and Y
+# derivatives will be 1.
+draw rect ortho 0 0 1 1 probe rect rgba (0, 0, 1, 1) (1, 1, 0, 1)
+
+# A larger rect being drawn, check that the first 2x2 quad, all of
+# which is definitely going to be covered, actually ended up as all 0's
+draw rect ortho 2 2 10 10
+probe rect rgba (2, 2, 2, 2) (0, 0, 0, 1)