[Piglit] [PATCH 7/8] gs: Verify checking of sized vs. unsized geometry shader input arrays.

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


These tests verify that if a single geometry shader compilation unit
contains a declaration of both an unsized and a sized input array, the
presence of the sized input array doesn't cause the unsized array to
acquire a size.
---
 ...nput-sizing-length-after-other-size-blocks.geom | 40 ++++++++++++++++++++++
 .../gs-input-sizing-length-after-other-size.geom   | 34 ++++++++++++++++++
 2 files changed, 74 insertions(+)
 create mode 100644 tests/spec/glsl-1.50/compiler/gs-input-sizing-length-after-other-size-blocks.geom
 create mode 100644 tests/spec/glsl-1.50/compiler/gs-input-sizing-length-after-other-size.geom

diff --git a/tests/spec/glsl-1.50/compiler/gs-input-sizing-length-after-other-size-blocks.geom b/tests/spec/glsl-1.50/compiler/gs-input-sizing-length-after-other-size-blocks.geom
new file mode 100644
index 0000000..5cd9320
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/gs-input-sizing-length-after-other-size-blocks.geom
@@ -0,0 +1,40 @@
+// Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec
+// includes the following examples of compile-time errors:
+//
+//   // code sequence within one shader...
+//   in vec4 Color1[];    // size unknown
+//   ...Color1.length()...// illegal, length() unknown
+//   in vec4 Color2[2];   // size is 2
+//   ...Color1.length()...// illegal, Color1 still has no size (*)
+//   in vec4 Color3[3];   // illegal, input sizes are inconsistent
+//   layout(lines) in;    // legal, input size is 2, matching
+//   in vec4 Color4[3];   // illegal, contradicts layout
+//   ...Color1.length()...// legal, length() is 2, Color1 sized by layout()
+//   layout(lines) in;    // legal, matches other layout() declaration
+//   layout(triangles) in;// illegal, does not match earlier layout() declaration
+//
+// This test verifies the case marked with (*), namely that declaring
+// a geometry shader input with a size does not cause previously
+// declared unsized geometry shader inputs to acquire that size.  This
+// test verifies the case for input interface blocks.
+//
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// check_link: false
+// [end config]
+
+#version 150
+
+in blk1 {
+  vec4 Color;
+} inst1[];
+
+in blk2 {
+  vec4 Color;
+} inst2[2];
+
+int foo()
+{
+  return inst1.length();
+}
diff --git a/tests/spec/glsl-1.50/compiler/gs-input-sizing-length-after-other-size.geom b/tests/spec/glsl-1.50/compiler/gs-input-sizing-length-after-other-size.geom
new file mode 100644
index 0000000..cd4b243
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/gs-input-sizing-length-after-other-size.geom
@@ -0,0 +1,34 @@
+// Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec
+// includes the following examples of compile-time errors:
+//
+//   // code sequence within one shader...
+//   in vec4 Color1[];    // size unknown
+//   ...Color1.length()...// illegal, length() unknown
+//   in vec4 Color2[2];   // size is 2
+//   ...Color1.length()...// illegal, Color1 still has no size (*)
+//   in vec4 Color3[3];   // illegal, input sizes are inconsistent
+//   layout(lines) in;    // legal, input size is 2, matching
+//   in vec4 Color4[3];   // illegal, contradicts layout
+//   ...Color1.length()...// legal, length() is 2, Color1 sized by layout()
+//   layout(lines) in;    // legal, matches other layout() declaration
+//   layout(triangles) in;// illegal, does not match earlier layout() declaration
+//
+// This test verifies the case marked with (*), namely that declaring
+// a geometry shader input with a size does not cause previously
+// declared unsized geometry shader inputs to acquire that size.
+//
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// check_link: false
+// [end config]
+
+#version 150
+
+in vec4 Color1[];
+in vec4 Color2[2];
+
+int foo()
+{
+  return Color1.length();
+}
-- 
1.8.3.4



More information about the Piglit mailing list