[Piglit] [PATCH 2/4] Rename and clarify interface-blocks-vs-gs-array-size-mismatch.shader_test.

Paul Berry stereotype441 at gmail.com
Wed Oct 30 22:27:57 CET 2013


The test was correct, but not for the reasons stated in the comment.
The reason a sized VS output interface array should fail to match an
unsized GS input interface array is because geometry shader inputs
require an extra level of array indexing to match corresponding vertex
shader outputs.

This patch renames the test, and updates the comment, to reflect
what's actually being tested.
---
 ...ce-blocks-vs-gs-array-size-mismatch.shader_test | 41 -----------------
 ...erface-vs-array-to-gs-array-unsized.shader_test | 52 ++++++++++++++++++++++
 2 files changed, 52 insertions(+), 41 deletions(-)
 delete mode 100644 tests/spec/glsl-1.50/linker/interface-blocks-vs-gs-array-size-mismatch.shader_test
 create mode 100644 tests/spec/glsl-1.50/linker/interface-vs-array-to-gs-array-unsized.shader_test

diff --git a/tests/spec/glsl-1.50/linker/interface-blocks-vs-gs-array-size-mismatch.shader_test b/tests/spec/glsl-1.50/linker/interface-blocks-vs-gs-array-size-mismatch.shader_test
deleted file mode 100644
index 5581ba8..0000000
--- a/tests/spec/glsl-1.50/linker/interface-blocks-vs-gs-array-size-mismatch.shader_test
+++ /dev/null
@@ -1,41 +0,0 @@
-# Test interface blocks declared as arrays must match array sizes.
-#
-# GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
-# "if a matching block is declared as an array, then the array sizes must
-#  also match"
-[require]
-GLSL >= 1.50
-
-[vertex shader]
-out block {
-    vec4 a;
-    vec4 b;
-} vs_block[3];
-
-void main()
-{
-	for(int i = 0; i < 3; i++) {
-		vs_block[i].a = vec4(1., 0., 0., 1.);
-	}
-}
-
-[geometry shader]
-layout(triangles) in;
-layout(triangle_strip, max_vertices=3) out;
-
-in block {
-    vec4 a;
-    vec4 b;
-} vs_block[];
-
-out vec4 color;
-
-void main()
-{
-	for(int i = 0; i < 2; i++) {
-		color = vs_block[i].a;
-	}
-}
-
-[test]
-link error
diff --git a/tests/spec/glsl-1.50/linker/interface-vs-array-to-gs-array-unsized.shader_test b/tests/spec/glsl-1.50/linker/interface-vs-array-to-gs-array-unsized.shader_test
new file mode 100644
index 0000000..54498f1
--- /dev/null
+++ b/tests/spec/glsl-1.50/linker/interface-vs-array-to-gs-array-unsized.shader_test
@@ -0,0 +1,52 @@
+# From the GLSL 1.50 spec, section 4.3.7 (Interface Blocks):
+#
+#     Matched block names within an interface (as defined above) must
+#     match in terms of having the same number of declarations with
+#     the same sequence of types and the same sequence of member
+#     names, as well as having the same member-wise layout
+#     qualification (see next section). Furthermore, if a matching
+#     block is declared as an array, then the array sizes must also
+#     match (or follow array matching rules for the interface between
+#     a vertex and a geometry shader).
+#
+# This test verifies that trying to link a VS output interface array
+# to an unsized GS input interface array fails, even if the implicit
+# size of the GS input interface array matches the explicit size of
+# the VS output interface array.
+
+[require]
+GLSL >= 1.50
+
+[vertex shader]
+out block {
+    vec4 a;
+    vec4 b;
+} vs_block[3];
+
+void main()
+{
+	for(int i = 0; i < 3; i++) {
+		vs_block[i].a = vec4(1., 0., 0., 1.);
+	}
+}
+
+[geometry shader]
+layout(triangles) in;
+layout(triangle_strip, max_vertices=3) out;
+
+in block {
+    vec4 a;
+    vec4 b;
+} vs_block[];
+
+out vec4 color;
+
+void main()
+{
+	for(int i = 0; i < 2; i++) {
+		color = vs_block[i].a;
+	}
+}
+
+[test]
+link error
-- 
1.8.4.2



More information about the Piglit mailing list