[Piglit] [PATCH] tests/spec: ARB_arrays_of_arrays compiler tests

Timothy Arceri t_arceri at yahoo.com.au
Sat Oct 5 13:21:43 CEST 2013


Signed-off-by: Timothy Arceri <t_arceri at yahoo.com.au>
---
 tests/all.tests                                    |    7 +++++++
 ...-function-parameter-declaration-new-syntax.vert |   17 ++++++++++++++++
 ...ay-of-array-function-parameter-declaration.vert |   17 ++++++++++++++++
 ...y-function-parameter-definition-new-syntax.vert |   20 +++++++++++++++++++
 ...ray-of-array-function-parameter-definition.vert |   20 +++++++++++++++++++
 .../array-of-array-structure-field-new-syntax.frag |   17 ++++++++++++++++
 .../compiler/array-of-array-structure-field.frag   |   17 ++++++++++++++++
 .../array-of-array-uniform-new-syntax.vert         |   15 ++++++++++++++
 ...f-array-uniform-unsized-invalid-new-syntax.vert |   21 ++++++++++++++++++++
 ...-array-uniform-unsized-invalid-new-syntax2.vert |   21 ++++++++++++++++++++
 .../array-of-array-uniform-unsized-invalid.vert    |   21 ++++++++++++++++++++
 .../array-of-array-uniform-unsized-invalid2.vert   |   21 ++++++++++++++++++++
 .../array-of-array-uniform-unsized-new-syntax.vert |   15 ++++++++++++++
 .../compiler/array-of-array-uniform-unsized.vert   |   15 ++++++++++++++
 .../compiler/array-of-array-uniform.vert           |   15 ++++++++++++++
 15 files changed, 259 insertions(+)
 create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-declaration-new-syntax.vert
 create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-declaration.vert
 create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-definition-new-syntax.vert
 create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-definition.vert
 create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/array-of-array-structure-field-new-syntax.frag
 create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/array-of-array-structure-field.frag
 create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-new-syntax.vert
 create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid-new-syntax.vert
 create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid-new-syntax2.vert
 create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid.vert
 create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid2.vert
 create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-new-syntax.vert
 create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized.vert
 create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform.vert

diff --git a/tests/all.tests b/tests/all.tests
index 3e5e1a3..1737138 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -1272,6 +1272,13 @@ for backing_type in ('texture', 'renderbuffer'):
                         'arb_framebuffer_srgb-' + test_name)
 add_plain_test(arb_framebuffer_srgb, 'framebuffer-srgb')
 
+# Group ARB_arrays_of_arrays
+arb_arrays_of_arrays = Group()
+spec['ARB_arrays_of_arrays'] = arb_arrays_of_arrays
+import_glsl_parser_tests(arb_arrays_of_arrays,
+			 os.path.join(testsDir, 'spec', 'arb_arrays_of_arrays'),
+			 ['compiler'])
+
 arb_gpu_shader5 = Group()
 spec['ARB_gpu_shader5'] = arb_gpu_shader5
 add_shader_test_dir(arb_gpu_shader5,
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-declaration-new-syntax.vert b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-declaration-new-syntax.vert
new file mode 100644
index 0000000..d4f8bf8
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-declaration-new-syntax.vert
@@ -0,0 +1,17 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+attribute vec4 vert;
+
+void foo(vec4 [2] x[2]);
+
+void main()
+{
+  gl_Position = vert;
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-declaration.vert b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-declaration.vert
new file mode 100644
index 0000000..60fec71
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-declaration.vert
@@ -0,0 +1,17 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+attribute vec4 vert;
+
+void foo(vec4 x[2][3]);
+
+void main()
+{
+  gl_Position = vert;
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-definition-new-syntax.vert b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-definition-new-syntax.vert
new file mode 100644
index 0000000..c93ed9d
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-definition-new-syntax.vert
@@ -0,0 +1,20 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+attribute vec4 vert;
+
+void foo(vec4 [2] x[2])
+{
+  gl_Position = vert;
+}
+
+void main()
+{
+  gl_Position = vert;
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-definition.vert b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-definition.vert
new file mode 100644
index 0000000..f43284a
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-definition.vert
@@ -0,0 +1,20 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+attribute vec4 vert;
+
+void foo(vec4 x[2][3])
+{
+  gl_Position = vert;
+}
+
+void main()
+{
+  gl_Position = vert;
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-structure-field-new-syntax.frag b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-structure-field-new-syntax.frag
new file mode 100644
index 0000000..54c4da5
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-structure-field-new-syntax.frag
@@ -0,0 +1,17 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+struct S {
+  vec4 [2] x[2];
+};
+
+void main()
+{
+  gl_FragData[0] = vec4(0.0);
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-structure-field.frag b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-structure-field.frag
new file mode 100644
index 0000000..e0de2b9
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-structure-field.frag
@@ -0,0 +1,17 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+struct S {
+  vec4 x[2][3];
+};
+
+void main()
+{
+  gl_FragData[0] = vec4(0.0);
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-new-syntax.vert b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-new-syntax.vert
new file mode 100644
index 0000000..588152e
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-new-syntax.vert
@@ -0,0 +1,15 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+uniform vec4 [1] an_array[1];
+
+void main()
+{
+  gl_Position = an_array[0][0];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid-new-syntax.vert b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid-new-syntax.vert
new file mode 100644
index 0000000..7af032a
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid-new-syntax.vert
@@ -0,0 +1,21 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ *
+ * For ARB_arrays_of_arrays spec:
+ * 
+ * "For unsized arrays, only the outermost dimension can be lacking a
+ *  size. A type that includes an unknown array size cannot be formed into
+ *  an array until it gets an explicit size."
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+uniform vec4 [] an_array[];
+
+void main()
+{
+  gl_Position = an_array[0][0];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid-new-syntax2.vert b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid-new-syntax2.vert
new file mode 100644
index 0000000..fcb0239
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid-new-syntax2.vert
@@ -0,0 +1,21 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ *
+ * For ARB_arrays_of_arrays spec:
+ * 
+ * "For unsized arrays, only the outermost dimension can be lacking a
+ *  size. A type that includes an unknown array size cannot be formed into
+ *  an array until it gets an explicit size."
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+uniform vec4 [] an_array[1];
+
+void main()
+{
+  gl_Position = an_array[0][0];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid.vert b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid.vert
new file mode 100644
index 0000000..83da6cc
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid.vert
@@ -0,0 +1,21 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ *
+ * For ARB_arrays_of_arrays spec:
+ * 
+ * "For unsized arrays, only the outermost dimension can be lacking a
+ *  size. A type that includes an unknown array size cannot be formed into
+ *  an array until it gets an explicit size."
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+uniform vec4 an_array[][];
+
+void main()
+{
+  gl_Position = an_array[0][0];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid2.vert b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid2.vert
new file mode 100644
index 0000000..49aacce
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid2.vert
@@ -0,0 +1,21 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ *
+ * For ARB_arrays_of_arrays spec:
+ * 
+ * "For unsized arrays, only the outermost dimension can be lacking a
+ *  size. A type that includes an unknown array size cannot be formed into
+ *  an array until it gets an explicit size."
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+uniform vec4 an_array[1][];
+
+void main()
+{
+  gl_Position = an_array[0][0];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-new-syntax.vert b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-new-syntax.vert
new file mode 100644
index 0000000..e801f65
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-new-syntax.vert
@@ -0,0 +1,15 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+uniform vec4 [1] an_array[];
+
+void main()
+{
+  gl_Position = an_array[0][0];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized.vert b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized.vert
new file mode 100644
index 0000000..99a52a1
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized.vert
@@ -0,0 +1,15 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+uniform vec4 an_array[][1];
+
+void main()
+{
+  gl_Position = an_array[0][0];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform.vert b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform.vert
new file mode 100644
index 0000000..95215bb
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform.vert
@@ -0,0 +1,15 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+uniform vec4 an_array[1][1];
+
+void main()
+{
+  gl_Position = an_array[0][0];
+}
-- 
1.7.9.5



More information about the Piglit mailing list