[Piglit] [PATCH 1/2] arb_gpu_shader5: Add shader tests to verify 'invocations' layout qualifier

Anuj Phogat anuj.phogat at gmail.com
Wed Feb 12 10:11:20 PST 2014


Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
---
 .../execution/invocations-conflicting.shader_test  | 47 ++++++++++++++++++++++
 .../execution/invocations-matching.shader_test     | 46 +++++++++++++++++++++
 2 files changed, 93 insertions(+)
 create mode 100644 tests/spec/arb_gpu_shader5/execution/invocations-conflicting.shader_test
 create mode 100644 tests/spec/arb_gpu_shader5/execution/invocations-matching.shader_test

diff --git a/tests/spec/arb_gpu_shader5/execution/invocations-conflicting.shader_test b/tests/spec/arb_gpu_shader5/execution/invocations-conflicting.shader_test
new file mode 100644
index 0000000..191d696
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/execution/invocations-conflicting.shader_test
@@ -0,0 +1,47 @@
+# ARB_gpu_shader5 spec says:
+#   "If an invocation count is declared, all such declarations
+#    must specify the same count."
+#
+# This test verifies that a link error occurs if two compilation units
+# declare conflicting number of invocations.
+
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader5
+
+[vertex shader passthrough]
+
+[geometry shader]
+
+#extension GL_ARB_gpu_shader5 : enable
+layout(lines, invocations=4) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+void do_vertex(int i);
+
+void main()
+{
+  for (int i = 0; i < 2; i++)
+    do_vertex(i);
+}
+
+[geometry shader]
+
+#extension GL_ARB_gpu_shader5 : enable
+layout(invocations=3) in;
+
+void do_vertex(int i)
+{
+}
+
+[fragment shader]
+
+out vec4 color;
+
+void main()
+{
+  color = vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+[test]
+link error
diff --git a/tests/spec/arb_gpu_shader5/execution/invocations-matching.shader_test b/tests/spec/arb_gpu_shader5/execution/invocations-matching.shader_test
new file mode 100644
index 0000000..a893d07
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/execution/invocations-matching.shader_test
@@ -0,0 +1,46 @@
+# ARB_gpu_shader5 spec says:
+#   "If an invocation count is declared, all such declarations
+#    must specify the same count."
+#
+# This test verifies the link success if two compilation units
+# declare the same number of invocations.
+
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader5
+
+[vertex shader passthrough]
+
+[geometry shader]
+
+#extension GL_ARB_gpu_shader5 : enable
+layout(lines, invocations=4) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+void do_vertex(int i);
+
+void main()
+{
+  for (int i = 0; i < 2; i++)
+    do_vertex(i);
+}
+
+[geometry shader]
+
+#extension GL_ARB_gpu_shader5 : enable
+layout(invocations=4) in;
+void do_vertex(int i)
+{
+}
+
+[fragment shader]
+
+out vec4 color;
+
+void main()
+{
+  color = vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+[test]
+link success
-- 
1.8.3.1



More information about the Piglit mailing list