[Piglit] [PATCH 20/23] arb_shading_language_420pack: Test initialized unsized arrays are identical

Matt Turner mattst88 at gmail.com
Sat Jun 29 19:43:13 PDT 2013


---
 ...aggregate-initializer-unsized-array.shader_test | 66 ++++++++++++++++++++++
 1 file changed, 66 insertions(+)
 create mode 100644 tests/spec/arb_shading_language_420pack/execution/aggregate-initializer-unsized-array.shader_test

diff --git a/tests/spec/arb_shading_language_420pack/execution/aggregate-initializer-unsized-array.shader_test b/tests/spec/arb_shading_language_420pack/execution/aggregate-initializer-unsized-array.shader_test
new file mode 100644
index 0000000..32ae7e6
--- /dev/null
+++ b/tests/spec/arb_shading_language_420pack/execution/aggregate-initializer-unsized-array.shader_test
@@ -0,0 +1,66 @@
+/* The ARB_shading_language_420pack suggests:
+ *
+ *    Verify that the following two arrays are identical:
+ *
+ *        vec4 a[] = vec4 [] (vec4(1.2), vec4(0.0), vec4(0.0), vec4(0.0),
+ *                            vec4(0.0), vec4(0.0), vec4(0.0), vec4(2.4),
+ *                            vec4(0.0), vec4(0.0), vec4(0.0), vec4(0.0),
+ *                            vec4(0.0), vec4(0.0), vec4(0.0), vec4(3.6));
+ *        vec4 b[] =        { vec4(1.2), vec4(0.0), vec4(0.0), vec4(0.0),
+ *                            vec4(0.0), vec4(0.0), vec4(0.0), vec4(2.4),
+ *                            vec4(0.0), vec4(0.0), vec4(0.0), vec4(0.0),
+ *                            vec4(0.0), vec4(0.0), vec4(0.0), vec4(3.6) };
+ */
+
+[require]
+GLSL >= 1.30
+GL_ARB_shading_language_420pack
+
+[vertex shader]
+#extension GL_ARB_shading_language_420pack: enable
+
+in vec4 vertex;
+out vec4 color;
+
+void main()
+{
+    vec4 a[] = vec4 [] (vec4(1.2), vec4(0.0), vec4(0.0), vec4(0.0),
+                        vec4(0.0), vec4(0.0), vec4(0.0), vec4(2.4),
+                        vec4(0.0), vec4(0.0), vec4(0.0), vec4(0.0),
+                        vec4(0.0), vec4(0.0), vec4(0.0), vec4(3.6));
+    vec4 b[] =        { vec4(1.2), vec4(0.0), vec4(0.0), vec4(0.0),
+                        vec4(0.0), vec4(0.0), vec4(0.0), vec4(2.4),
+                        vec4(0.0), vec4(0.0), vec4(0.0), vec4(0.0),
+                        vec4(0.0), vec4(0.0), vec4(0.0), vec4(3.6) };
+
+    color = vec4(0.0, 1.0, 0.0, 1.0);
+
+    if (a.length() != b.length()) {
+        color = vec4(0.0, 0.0, 1.0, 1.0);
+    } else {
+        for (int i = 0; i < a.length(); i++) {
+            if (a[i] != b[i]) {
+                color = vec4(1.0, 0.0, 0.0, 1.0);
+            }
+        }
+    }
+    gl_Position = vertex;
+}
+
+[fragment shader]
+in vec4 color;
+
+void main() {
+    gl_FragColor = color;;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0  1.0
+-1.0  1.0
+
+[test]
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 1.0
-- 
1.8.1.5



More information about the Piglit mailing list