Signed-off-by: Anuj Phogat <[email protected]>
---
 .../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

_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to