[Piglit] [PATCH] gs: Test layout vs explicit size more thoroughly.

Paul Berry stereotype441 at gmail.com
Sat Jul 27 08:38:36 PDT 2013


Don't just test the case where one compilation unit specifies a layout
with N vertices and another compilation unit specifies an input with
size >N.  Also test the case where the second compilation unit
specifies an input with size <N.

This patch should be squashed with "gs: Test rules related to geometry
shader input sizes."
---
 ...ing-layout-greater-than-size-blocks.shader_test | 67 ++++++++++++++++++++++
 ...put-sizing-layout-greater-than-size.shader_test | 60 +++++++++++++++++++
 ...izing-layout-less-than-size-blocks.shader_test} |  3 +
 ...input-sizing-layout-less-than-size.shader_test} |  3 +
 4 files changed, 133 insertions(+)
 create mode 100644 tests/spec/glsl-1.50/linker/gs-input-sizing-layout-greater-than-size-blocks.shader_test
 create mode 100644 tests/spec/glsl-1.50/linker/gs-input-sizing-layout-greater-than-size.shader_test
 rename tests/spec/glsl-1.50/linker/{gs-input-sizing-layout-conflicts-with-size-blocks.shader_test => gs-input-sizing-layout-less-than-size-blocks.shader_test} (87%)
 rename tests/spec/glsl-1.50/linker/{gs-input-sizing-layout-conflicts-with-size.shader_test => gs-input-sizing-layout-less-than-size.shader_test} (85%)

diff --git a/tests/spec/glsl-1.50/linker/gs-input-sizing-layout-greater-than-size-blocks.shader_test b/tests/spec/glsl-1.50/linker/gs-input-sizing-layout-greater-than-size-blocks.shader_test
new file mode 100644
index 0000000..96c618a
--- /dev/null
+++ b/tests/spec/glsl-1.50/linker/gs-input-sizing-layout-greater-than-size-blocks.shader_test
@@ -0,0 +1,67 @@
+# Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec says:
+#
+# It is a link-time error if not all provided sizes (sized input
+# arrays and layout size) match across all geometry shaders in the
+# program.
+#
+# This test exercises the case where the layout size is greater than
+# the size of a sized input array in another compilation unit.
+#
+# This test verifies the case for input interface blocks.
+
+[require]
+GLSL >= 1.50
+
+[vertex shader]
+#version 150
+
+in vec4 vertex;
+
+out blk {
+  vec4 vertex_to_gs;
+};
+
+void main()
+{
+  vertex_to_gs = vertex;
+}
+
+[geometry shader]
+#version 150
+
+layout(triangles) 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]
+#version 150
+
+in blk {
+  vec4 vertex_to_gs;
+} inst[2];
+
+void do_vertex(int i)
+{
+  gl_Position = inst[i].vertex_to_gs;
+  EmitVertex();
+}
+
+[fragment shader]
+#version 150
+
+out vec4 color;
+
+void main()
+{
+  color = vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+[test]
+link error
diff --git a/tests/spec/glsl-1.50/linker/gs-input-sizing-layout-greater-than-size.shader_test b/tests/spec/glsl-1.50/linker/gs-input-sizing-layout-greater-than-size.shader_test
new file mode 100644
index 0000000..30bcc7f
--- /dev/null
+++ b/tests/spec/glsl-1.50/linker/gs-input-sizing-layout-greater-than-size.shader_test
@@ -0,0 +1,60 @@
+# Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec says:
+#
+# It is a link-time error if not all provided sizes (sized input
+# arrays and layout size) match across all geometry shaders in the
+# program.
+#
+# This test exercises the case where the layout size is greater than
+# the size of a sized input array in another compilation unit.
+
+[require]
+GLSL >= 1.50
+
+[vertex shader]
+#version 150
+
+in vec4 vertex;
+out vec4 vertex_to_gs;
+
+void main()
+{
+  vertex_to_gs = vertex;
+}
+
+[geometry shader]
+#version 150
+
+layout(triangles) 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]
+#version 150
+
+in vec4 vertex_to_gs[2];
+
+void do_vertex(int i)
+{
+  gl_Position = vertex_to_gs[i];
+  EmitVertex();
+}
+
+[fragment shader]
+#version 150
+
+out vec4 color;
+
+void main()
+{
+  color = vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+[test]
+link error
diff --git a/tests/spec/glsl-1.50/linker/gs-input-sizing-layout-conflicts-with-size-blocks.shader_test b/tests/spec/glsl-1.50/linker/gs-input-sizing-layout-less-than-size-blocks.shader_test
similarity index 87%
rename from tests/spec/glsl-1.50/linker/gs-input-sizing-layout-conflicts-with-size-blocks.shader_test
rename to tests/spec/glsl-1.50/linker/gs-input-sizing-layout-less-than-size-blocks.shader_test
index 09e88c1..1f9ccc7 100644
--- a/tests/spec/glsl-1.50/linker/gs-input-sizing-layout-conflicts-with-size-blocks.shader_test
+++ b/tests/spec/glsl-1.50/linker/gs-input-sizing-layout-less-than-size-blocks.shader_test
@@ -4,6 +4,9 @@
 # arrays and layout size) match across all geometry shaders in the
 # program.
 #
+# This test exercises the case where the layout size is less than the
+# size of a sized input array in another compilation unit.
+#
 # This test verifies the case for input interface blocks.
 
 [require]
diff --git a/tests/spec/glsl-1.50/linker/gs-input-sizing-layout-conflicts-with-size.shader_test b/tests/spec/glsl-1.50/linker/gs-input-sizing-layout-less-than-size.shader_test
similarity index 85%
rename from tests/spec/glsl-1.50/linker/gs-input-sizing-layout-conflicts-with-size.shader_test
rename to tests/spec/glsl-1.50/linker/gs-input-sizing-layout-less-than-size.shader_test
index a7e2a59..4885dfd 100644
--- a/tests/spec/glsl-1.50/linker/gs-input-sizing-layout-conflicts-with-size.shader_test
+++ b/tests/spec/glsl-1.50/linker/gs-input-sizing-layout-less-than-size.shader_test
@@ -3,6 +3,9 @@
 # It is a link-time error if not all provided sizes (sized input
 # arrays and layout size) match across all geometry shaders in the
 # program.
+#
+# This test exercises the case where the layout size is less than the
+# size of a sized input array in another compilation unit.
 
 [require]
 GLSL >= 1.50
-- 
1.8.3.4



More information about the Piglit mailing list