[Piglit] [PATCH 3/8] gs: Verify inter-shader checking of input layout vs. explicitly sized arrays.

Paul Berry stereotype441 at gmail.com
Mon Aug 12 15:03:24 PDT 2013


These tests verify that the implementation properly detects mismatches
between a geometry shader input layout declaration and an explicitly
sized geometry shader input array appearing in a different shader (the
size of each input array must match the number of vertices per
primitive implied by the input layout declaration).
---
 ...ing-layout-greater-than-size-blocks.shader_test | 67 ++++++++++++++++++++++
 ...put-sizing-layout-greater-than-size.shader_test | 60 +++++++++++++++++++
 ...sizing-layout-less-than-size-blocks.shader_test | 67 ++++++++++++++++++++++
 ...-input-sizing-layout-less-than-size.shader_test | 60 +++++++++++++++++++
 4 files changed, 254 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
 create mode 100644 tests/spec/glsl-1.50/linker/gs-input-sizing-layout-less-than-size-blocks.shader_test
 create mode 100644 tests/spec/glsl-1.50/linker/gs-input-sizing-layout-less-than-size.shader_test

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-less-than-size-blocks.shader_test b/tests/spec/glsl-1.50/linker/gs-input-sizing-layout-less-than-size-blocks.shader_test
new file mode 100644
index 0000000..1f9ccc7
--- /dev/null
+++ b/tests/spec/glsl-1.50/linker/gs-input-sizing-layout-less-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 less 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(lines) 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[3];
+
+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-less-than-size.shader_test b/tests/spec/glsl-1.50/linker/gs-input-sizing-layout-less-than-size.shader_test
new file mode 100644
index 0000000..4885dfd
--- /dev/null
+++ b/tests/spec/glsl-1.50/linker/gs-input-sizing-layout-less-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 less 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(lines) 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[3];
+
+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
-- 
1.8.3.4



More information about the Piglit mailing list