[Piglit] [PATCH 6/8] gs: Verify consistency checking of explicitly sized input arrays.

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


These tests verify that the implementation properly detects mismatches
between sized geometry shader input arrays appearing within the same
compilation unit.
---
 .../gs-input-sizing-inconsistent-blocks.geom       | 35 ++++++++++++++++++++++
 .../compiler/gs-input-sizing-inconsistent.geom     | 29 ++++++++++++++++++
 2 files changed, 64 insertions(+)
 create mode 100644 tests/spec/glsl-1.50/compiler/gs-input-sizing-inconsistent-blocks.geom
 create mode 100644 tests/spec/glsl-1.50/compiler/gs-input-sizing-inconsistent.geom

diff --git a/tests/spec/glsl-1.50/compiler/gs-input-sizing-inconsistent-blocks.geom b/tests/spec/glsl-1.50/compiler/gs-input-sizing-inconsistent-blocks.geom
new file mode 100644
index 0000000..860455f
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/gs-input-sizing-inconsistent-blocks.geom
@@ -0,0 +1,35 @@
+// 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
+// two geometry shader inputs with different array sizes causes a
+// compile error.  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;
+} inst2[2];
+
+in blk2 {
+  vec4 Color;
+} inst3[3];
diff --git a/tests/spec/glsl-1.50/compiler/gs-input-sizing-inconsistent.geom b/tests/spec/glsl-1.50/compiler/gs-input-sizing-inconsistent.geom
new file mode 100644
index 0000000..568ea5a
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/gs-input-sizing-inconsistent.geom
@@ -0,0 +1,29 @@
+// 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
+// two geometry shader inputs with different array sizes causes a
+// compile error.
+//
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// check_link: false
+// [end config]
+
+#version 150
+
+in vec4 Color2[2];
+in vec4 Color3[3];
-- 
1.8.3.4



More information about the Piglit mailing list