[Piglit] [PATCH V2 1/9] tests/spec: ARB_arrays_of_arrays initializer and constructor tests
Timothy Arceri
t_arceri at yahoo.com.au
Tue Jan 14 00:19:59 PST 2014
---
tests/all.tests | 7 +++
.../compiler/constructor-array-array-var.vert | 17 +++++++
.../compiler/constructor-array-var-array.vert | 17 +++++++
.../constructor-arrays-of-arrays-same-size.vert | 24 ++++++++++
.../compiler/constructor-invalid-assignment.vert | 17 +++++++
.../constructor-invalid-dimensions-mismatch.vert | 20 ++++++++
.../constructor-invalid-element-to-big.vert | 17 +++++++
.../compiler/constructor-invalid-type.vert | 17 +++++++
.../compiler/constructor-invalid.vert | 17 +++++++
.../compiler/constructor-invalid2.vert | 16 +++++++
.../compiler/constructor-three-dimensions.vert | 20 ++++++++
.../compiler/constructor-unsized.vert | 17 +++++++
.../compiler/constructor-var-array-array.vert | 17 +++++++
.../compiler/initialization-invalid.vert | 17 +++++++
.../compiler/initialization-invalid2.vert | 19 ++++++++
.../compiler/initialization-invalid3.vert | 19 ++++++++
.../compiler/initialization-invalid4.vert | 19 ++++++++
.../compiler/initializer-array-array-var.vert | 19 ++++++++
.../compiler/initializer-array-array-var2.vert | 19 ++++++++
.../compiler/initializer-array-var-array.vert | 19 ++++++++
.../compiler/initializer-array-var-array2.vert | 19 ++++++++
...alizer-dec-list-type-array-array-var1-var2.vert | 43 ++++++++++++++++++
...-dec-list-type-array-var1-array-var2-array.vert | 47 +++++++++++++++++++
...ist-type-var1-array-array-var2-array-array.vert | 43 ++++++++++++++++++
.../initializer-struct-field-array-array-var.vert | 34 ++++++++++++++
.../initializer-struct-field-array-var-array.vert | 34 ++++++++++++++
...truct-field-dec-list-array-array-var1-var2.vert | 48 ++++++++++++++++++++
...truct-field-dec-list-array-var1-array-var2.vert | 38 ++++++++++++++++
...truct-field-dec-list-array-var1-var2-array.vert | 38 ++++++++++++++++
.../initializer-struct-field-var-array-array.vert | 34 ++++++++++++++
.../compiler/initializer-three-dimensions.vert | 22 +++++++++
.../compiler/initializer-three-dimensions2.vert | 22 +++++++++
.../compiler/initializer-var-array-array.vert | 19 ++++++++
.../compiler/initializer-var-array-array2.vert | 19 ++++++++
34 files changed, 814 insertions(+)
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/constructor-array-array-var.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/constructor-array-var-array.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/constructor-arrays-of-arrays-same-size.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/constructor-invalid-assignment.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/constructor-invalid-dimensions-mismatch.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/constructor-invalid-element-to-big.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/constructor-invalid-type.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/constructor-invalid.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/constructor-invalid2.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/constructor-three-dimensions.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/constructor-unsized.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/constructor-var-array-array.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/initialization-invalid.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/initialization-invalid2.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/initialization-invalid3.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/initialization-invalid4.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/initializer-array-array-var.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/initializer-array-array-var2.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/initializer-array-var-array.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/initializer-array-var-array2.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/initializer-dec-list-type-array-array-var1-var2.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/initializer-dec-list-type-array-var1-array-var2-array.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/initializer-dec-list-type-var1-array-array-var2-array-array.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/initializer-struct-field-array-array-var.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/initializer-struct-field-array-var-array.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/initializer-struct-field-dec-list-array-array-var1-var2.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/initializer-struct-field-dec-list-array-var1-array-var2.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/initializer-struct-field-dec-list-array-var1-var2-array.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/initializer-struct-field-var-array-array.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/initializer-three-dimensions.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/initializer-three-dimensions2.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/initializer-var-array-array.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/initializer-var-array-array2.vert
diff --git a/tests/all.tests b/tests/all.tests
index edf066b..bc2314b 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -1065,6 +1065,13 @@ import_glsl_parser_tests(spec['AMD_conservative_depth'],
os.path.join(testsDir, 'spec', 'amd_conservative_depth'),
[''])
+# 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'])
+
# Group ARB_point_sprite
arb_point_sprite = Group()
spec['ARB_point_sprite'] = arb_point_sprite
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/constructor-array-array-var.vert b/tests/spec/arb_arrays_of_arrays/compiler/constructor-array-array-var.vert
new file mode 100644
index 0000000..5b88054
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/constructor-array-array-var.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
+
+void main()
+{
+ vec4[3][2] a = vec4[3][2](vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0)));
+
+ gl_Position = a[2][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/constructor-array-var-array.vert b/tests/spec/arb_arrays_of_arrays/compiler/constructor-array-var-array.vert
new file mode 100644
index 0000000..03fd090
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/constructor-array-var-array.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
+
+void main()
+{
+ vec4[2] a[3] = vec4[3][2](vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0)));
+
+ gl_Position = a[2][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/constructor-arrays-of-arrays-same-size.vert b/tests/spec/arb_arrays_of_arrays/compiler/constructor-arrays-of-arrays-same-size.vert
new file mode 100644
index 0000000..b2f35e9
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/constructor-arrays-of-arrays-same-size.vert
@@ -0,0 +1,24 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ *
+ * This test is useful as it tests that the second dimension which is
+ * the same size as the first dimension gets its own glsl_type object
+ * in Mesa. If not all dimension information is used when creating
+ * a key to represent the object then the wrong object can be retrived.
+ * i.e we get the glsl_type for vec4[3][3] rather than vec4[3]
+ *
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+void main()
+{
+ vec4[3][3] a = vec4[3][3](vec4[3](vec4(0.0), vec4(0.0), vec4(1.0)),
+ vec4[3](vec4(0.0), vec4(0.0), vec4(1.0)),
+ vec4[3](vec4(0.0), vec4(0.0), vec4(1.0)));
+
+ gl_Position = a[2][2];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/constructor-invalid-assignment.vert b/tests/spec/arb_arrays_of_arrays/compiler/constructor-invalid-assignment.vert
new file mode 100644
index 0000000..11edac8
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/constructor-invalid-assignment.vert
@@ -0,0 +1,17 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+void main()
+{
+ vec4[3] a = vec4[3][2](vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0)));
+
+ gl_Position = a[2][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/constructor-invalid-dimensions-mismatch.vert b/tests/spec/arb_arrays_of_arrays/compiler/constructor-invalid-dimensions-mismatch.vert
new file mode 100644
index 0000000..d4d16fa
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/constructor-invalid-dimensions-mismatch.vert
@@ -0,0 +1,20 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+void main()
+{
+ vec4[3][2] a = vec4[3][2](vec4[2][2](vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0))),
+ vec4[2][2](vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0))),
+ vec4[2][2](vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0))));
+
+ gl_Position = a[2][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/constructor-invalid-element-to-big.vert b/tests/spec/arb_arrays_of_arrays/compiler/constructor-invalid-element-to-big.vert
new file mode 100644
index 0000000..bfe6ebc
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/constructor-invalid-element-to-big.vert
@@ -0,0 +1,17 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+void main()
+{
+ vec4[3][2] a = vec4[3][2](vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[3](vec4(0.0), vec4(1.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0)));
+
+ gl_Position = a[2][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/constructor-invalid-type.vert b/tests/spec/arb_arrays_of_arrays/compiler/constructor-invalid-type.vert
new file mode 100644
index 0000000..8283c39
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/constructor-invalid-type.vert
@@ -0,0 +1,17 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+void main()
+{
+ vec4[3][2] a = vec4[3][2](vec3[2](vec3(0.0), vec3(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0)));
+
+ gl_Position = a[2][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/constructor-invalid.vert b/tests/spec/arb_arrays_of_arrays/compiler/constructor-invalid.vert
new file mode 100644
index 0000000..025fa01
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/constructor-invalid.vert
@@ -0,0 +1,17 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+void main()
+{
+ vec4[3][3] a = vec4[3][3](vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0)));
+
+ gl_Position = a[2][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/constructor-invalid2.vert b/tests/spec/arb_arrays_of_arrays/compiler/constructor-invalid2.vert
new file mode 100644
index 0000000..182a03a
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/constructor-invalid2.vert
@@ -0,0 +1,16 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+void main()
+{
+ vec4[3][2] a = vec4[3][2](vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0)));
+
+ gl_Position = a[2][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/constructor-three-dimensions.vert b/tests/spec/arb_arrays_of_arrays/compiler/constructor-three-dimensions.vert
new file mode 100644
index 0000000..35b5fd0
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/constructor-three-dimensions.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
+
+void main()
+{
+ vec4 a[3][2][2] = vec4[3][2][2](vec4[2][2](vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0))),
+ vec4[2][2](vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0))),
+ vec4[2][2](vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0))));
+
+ gl_Position = a[2][1][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/constructor-unsized.vert b/tests/spec/arb_arrays_of_arrays/compiler/constructor-unsized.vert
new file mode 100644
index 0000000..8575a26
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/constructor-unsized.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
+
+void main()
+{
+ float x[][2] = float[][2](float[2](1., 2.),
+ float[2](1., 2.),
+ float[2](1., 2.));
+
+ gl_Position = vec4(x[0][0]);
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/constructor-var-array-array.vert b/tests/spec/arb_arrays_of_arrays/compiler/constructor-var-array-array.vert
new file mode 100644
index 0000000..847e4ed
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/constructor-var-array-array.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
+
+void main()
+{
+ vec4 a[3][2] = vec4[3][2](vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0)));
+
+ gl_Position = a[2][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/initialization-invalid.vert b/tests/spec/arb_arrays_of_arrays/compiler/initialization-invalid.vert
new file mode 100644
index 0000000..f6870a0
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/initialization-invalid.vert
@@ -0,0 +1,17 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+void main()
+{
+ vec4[4][2] a = vec4[3][2](vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0)));
+
+ gl_Position = a[2][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/initialization-invalid2.vert b/tests/spec/arb_arrays_of_arrays/compiler/initialization-invalid2.vert
new file mode 100644
index 0000000..23da9ce
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/initialization-invalid2.vert
@@ -0,0 +1,19 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * require_extensions: GL_ARB_shading_language_420pack
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+#extension GL_ARB_shading_language_420pack: enable
+
+void main()
+{
+ vec4 a[2][2] = {{ vec4(0.0), vec4(1.0) },
+ { vec4(0.0), vec4(1.0) },
+ { vec4(0.0), vec4(1.0) }};
+
+ gl_Position = a[2][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/initialization-invalid3.vert b/tests/spec/arb_arrays_of_arrays/compiler/initialization-invalid3.vert
new file mode 100644
index 0000000..412088f
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/initialization-invalid3.vert
@@ -0,0 +1,19 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * require_extensions: GL_ARB_shading_language_420pack
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+#extension GL_ARB_shading_language_420pack: enable
+
+void main()
+{
+ vec4 a[3][3] = {vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0)) };
+
+ gl_Position = a[2][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/initialization-invalid4.vert b/tests/spec/arb_arrays_of_arrays/compiler/initialization-invalid4.vert
new file mode 100644
index 0000000..4c32e97
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/initialization-invalid4.vert
@@ -0,0 +1,19 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * require_extensions: GL_ARB_shading_language_420pack
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+#extension GL_ARB_shading_language_420pack: enable
+
+void main()
+{
+ vec4 a[2][2] = {vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0)) };
+
+ gl_Position = a[2][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/initializer-array-array-var.vert b/tests/spec/arb_arrays_of_arrays/compiler/initializer-array-array-var.vert
new file mode 100644
index 0000000..993bf60
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/initializer-array-array-var.vert
@@ -0,0 +1,19 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * require_extensions: GL_ARB_shading_language_420pack
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+#extension GL_ARB_shading_language_420pack: enable
+
+void main()
+{
+ vec4[3][2] a = {vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0)) };
+
+ gl_Position = a[2][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/initializer-array-array-var2.vert b/tests/spec/arb_arrays_of_arrays/compiler/initializer-array-array-var2.vert
new file mode 100644
index 0000000..7e77f3e
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/initializer-array-array-var2.vert
@@ -0,0 +1,19 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * require_extensions: GL_ARB_shading_language_420pack
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+#extension GL_ARB_shading_language_420pack: enable
+
+void main()
+{
+ vec4[3][2] a = {{ vec4(0.0), vec4(1.0) },
+ { vec4(0.0), vec4(1.0) },
+ { vec4(0.0), vec4(1.0) }};
+
+ gl_Position = a[2][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/initializer-array-var-array.vert b/tests/spec/arb_arrays_of_arrays/compiler/initializer-array-var-array.vert
new file mode 100644
index 0000000..d4c7e58
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/initializer-array-var-array.vert
@@ -0,0 +1,19 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * require_extensions: GL_ARB_shading_language_420pack
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+#extension GL_ARB_shading_language_420pack: enable
+
+void main()
+{
+ vec4[2] a[3] = {vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0)) };
+
+ gl_Position = a[2][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/initializer-array-var-array2.vert b/tests/spec/arb_arrays_of_arrays/compiler/initializer-array-var-array2.vert
new file mode 100644
index 0000000..2a93dda
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/initializer-array-var-array2.vert
@@ -0,0 +1,19 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * require_extensions: GL_ARB_shading_language_420pack
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+#extension GL_ARB_shading_language_420pack: enable
+
+void main()
+{
+ vec4[2] a[3] = {{ vec4(0.0), vec4(1.0) },
+ { vec4(0.0), vec4(1.0) },
+ { vec4(0.0), vec4(1.0) }};
+
+ gl_Position = a[2][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/initializer-dec-list-type-array-array-var1-var2.vert b/tests/spec/arb_arrays_of_arrays/compiler/initializer-dec-list-type-array-array-var1-var2.vert
new file mode 100644
index 0000000..287fadd
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/initializer-dec-list-type-array-array-var1-var2.vert
@@ -0,0 +1,43 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * require_extensions: GL_ARB_shading_language_420pack
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+#extension GL_ARB_shading_language_420pack: enable
+
+void main()
+{
+ vec4[3][2] a = {
+ {
+ vec4(1.0), // a[0][0]
+ vec4(1.0) // a[0][1]
+ },
+ {
+ vec4(1.0), // a[1][0]
+ vec4(1.0) // a[1][1]
+ },
+ {
+ vec4(1.0), // a[2][0]
+ vec4(1.0) // a[2][1]
+ }
+ }, b = {
+ {
+ vec4(1.0), // b[0][0]
+ vec4(1.0) // b[0][1]
+ },
+ {
+ vec4(1.0), // b[1][0]
+ vec4(1.0) // b[1][1]
+ },
+ {
+ vec4(1.0), // b[2][0]
+ vec4(1.0) // b[2][1]
+ }
+ }; // b
+
+ gl_Position = b[2][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/initializer-dec-list-type-array-var1-array-var2-array.vert b/tests/spec/arb_arrays_of_arrays/compiler/initializer-dec-list-type-array-var1-array-var2-array.vert
new file mode 100644
index 0000000..844081a
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/initializer-dec-list-type-array-var1-array-var2-array.vert
@@ -0,0 +1,47 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * require_extensions: GL_ARB_shading_language_420pack
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+#extension GL_ARB_shading_language_420pack: enable
+
+void main()
+{
+ vec4[2] a[4] = {
+ {
+ vec4(1.0), // a[0][0]
+ vec4(1.0) // a[0][1]
+ },
+ {
+ vec4(1.0), // a[1][0]
+ vec4(1.0) // a[1][1]
+ },
+ {
+ vec4(1.0), // a[2][0]
+ vec4(1.0) // a[2][1]
+ },
+ {
+ vec4(1.0), // a[3][0]
+ vec4(1.0) // a[3][1]
+ }
+ }, b[3] = {
+ {
+ vec4(1.0), // b[0][0]
+ vec4(1.0) // b[0][1]
+ },
+ {
+ vec4(1.0), // b[1][0]
+ vec4(1.0) // b[1][1]
+ },
+ {
+ vec4(1.0), // b[2][0]
+ vec4(1.0) // b[2][1]
+ }
+ }; // b
+
+ gl_Position = b[2][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/initializer-dec-list-type-var1-array-array-var2-array-array.vert b/tests/spec/arb_arrays_of_arrays/compiler/initializer-dec-list-type-var1-array-array-var2-array-array.vert
new file mode 100644
index 0000000..c7c97e4
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/initializer-dec-list-type-var1-array-array-var2-array-array.vert
@@ -0,0 +1,43 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * require_extensions: GL_ARB_shading_language_420pack
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+#extension GL_ARB_shading_language_420pack: enable
+
+void main()
+{
+ vec4 a[3][2] = {
+ {
+ vec4(1.0), // a[0][0]
+ vec4(1.0) // a[0][1]
+ },
+ {
+ vec4(1.0), // a[1][0]
+ vec4(1.0) // a[1][1]
+ },
+ {
+ vec4(1.0), // a[2][0]
+ vec4(1.0) // a[2][1]
+ }
+ }, b[3][2] = {
+ {
+ vec4(1.0), // b[0][0]
+ vec4(1.0) // b[0][1]
+ },
+ {
+ vec4(1.0), // b[1][0]
+ vec4(1.0) // b[1][1]
+ },
+ {
+ vec4(1.0), // b[2][0]
+ vec4(1.0) // b[2][1]
+ }
+ }; // b
+
+ gl_Position = b[2][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/initializer-struct-field-array-array-var.vert b/tests/spec/arb_arrays_of_arrays/compiler/initializer-struct-field-array-array-var.vert
new file mode 100644
index 0000000..1d0cedf
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/initializer-struct-field-array-array-var.vert
@@ -0,0 +1,34 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * require_extensions: GL_ARB_shading_language_420pack
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+#extension GL_ARB_shading_language_420pack: enable
+
+void main()
+{
+ struct {
+ vec4[3][2] a;
+ } aggregate = {
+ {
+ {
+ {1.0, 2.0, 3.0, 4.0}, // a[0][0]
+ {5.0, 6.0, 7.0, 8.0} // a[0][1]
+ }, // a[0]
+ {
+ {1.0, 2.0, 3.0, 4.0}, // a[1][0]
+ {5.0, 6.0, 7.0, 8.0} // a[1][1]
+ }, // a[1]
+ {
+ {1.0, 2.0, 3.0, 4.0}, // a[2][0]
+ {5.0, 6.0, 7.0, 8.0} // a[2][1]
+ } // a[2]
+ }
+ };
+
+ gl_Position = aggregate.a[2][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/initializer-struct-field-array-var-array.vert b/tests/spec/arb_arrays_of_arrays/compiler/initializer-struct-field-array-var-array.vert
new file mode 100644
index 0000000..5afc308
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/initializer-struct-field-array-var-array.vert
@@ -0,0 +1,34 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * require_extensions: GL_ARB_shading_language_420pack
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+#extension GL_ARB_shading_language_420pack: enable
+
+void main()
+{
+ struct {
+ vec4[2] a[3];
+ } aggregate = {
+ {
+ {
+ {1.0, 2.0, 3.0, 4.0}, // a[0][0]
+ {5.0, 6.0, 7.0, 8.0} // a[0][1]
+ }, // a[0]
+ {
+ {1.0, 2.0, 3.0, 4.0}, // a[1][0]
+ {5.0, 6.0, 7.0, 8.0} // a[1][1]
+ }, // a[1]
+ {
+ {1.0, 2.0, 3.0, 4.0}, // a[2][0]
+ {5.0, 6.0, 7.0, 8.0} // a[2][1]
+ } // a[2]
+ }
+ };
+
+ gl_Position = aggregate.a[2][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/initializer-struct-field-dec-list-array-array-var1-var2.vert b/tests/spec/arb_arrays_of_arrays/compiler/initializer-struct-field-dec-list-array-array-var1-var2.vert
new file mode 100644
index 0000000..b0abb4a
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/initializer-struct-field-dec-list-array-array-var1-var2.vert
@@ -0,0 +1,48 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * require_extensions: GL_ARB_shading_language_420pack
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+#extension GL_ARB_shading_language_420pack: enable
+
+void main()
+{
+ struct {
+ vec4[3][2] a, b;
+ } aggregate = {
+ {
+ {
+ {1.0, 2.0, 3.0, 4.0}, // a[0][0]
+ {5.0, 6.0, 7.0, 8.0} // a[0][1]
+ }, // a[0]
+ {
+ {1.0, 2.0, 3.0, 4.0}, // a[1][0]
+ {5.0, 6.0, 7.0, 8.0} // a[1][1]
+ }, // a[1]
+ {
+ {1.0, 2.0, 3.0, 4.0}, // a[2][0]
+ {5.0, 6.0, 7.0, 8.0} // a[2][1]
+ } // a[2]
+ }, // a
+ {
+ {
+ {1.0, 2.0, 3.0, 4.0}, // b[0][0]
+ {5.0, 6.0, 7.0, 8.0} // b[0][1]
+ }, // b[0]
+ {
+ {1.0, 2.0, 3.0, 4.0}, // b[1][0]
+ {5.0, 6.0, 7.0, 8.0} // b[1][1]
+ }, // b[1]
+ {
+ {1.0, 2.0, 3.0, 4.0}, // b[2][0]
+ {5.0, 6.0, 7.0, 8.0} // b[2][1]
+ } // b[2]
+ } // b
+ };
+
+ gl_Position = aggregate.a[2][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/initializer-struct-field-dec-list-array-var1-array-var2.vert b/tests/spec/arb_arrays_of_arrays/compiler/initializer-struct-field-dec-list-array-var1-array-var2.vert
new file mode 100644
index 0000000..782349b
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/initializer-struct-field-dec-list-array-var1-array-var2.vert
@@ -0,0 +1,38 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * require_extensions: GL_ARB_shading_language_420pack
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+#extension GL_ARB_shading_language_420pack: enable
+
+void main()
+{
+ struct {
+ vec4[2] a[3], b;
+ } aggregate = {
+ {
+ {
+ {1.0, 2.0, 3.0, 4.0}, // a[0][0]
+ {5.0, 6.0, 7.0, 8.0} // a[0][1]
+ }, // a[0]
+ {
+ {1.0, 2.0, 3.0, 4.0}, // a[1][0]
+ {5.0, 6.0, 7.0, 8.0} // a[1][1]
+ }, // a[1]
+ {
+ {1.0, 2.0, 3.0, 4.0}, // a[2][0]
+ {5.0, 6.0, 7.0, 8.0} // a[2][1]
+ } // a[2]
+ }, // a
+ {
+ { 1.0, 2.0, 3.0, 4.0 }, // b[0]
+ { 1.0, 2.0, 3.0, 4.0 } // b[1]
+ }
+ };
+
+ gl_Position = aggregate.a[2][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/initializer-struct-field-dec-list-array-var1-var2-array.vert b/tests/spec/arb_arrays_of_arrays/compiler/initializer-struct-field-dec-list-array-var1-var2-array.vert
new file mode 100644
index 0000000..6663337
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/initializer-struct-field-dec-list-array-var1-var2-array.vert
@@ -0,0 +1,38 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * require_extensions: GL_ARB_shading_language_420pack
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+#extension GL_ARB_shading_language_420pack: enable
+
+void main()
+{
+ struct {
+ vec4[2] b, a[3];
+ } aggregate = {
+ {
+ { 1.0, 2.0, 3.0, 4.0 }, // b[0]
+ { 1.0, 2.0, 3.0, 4.0 } // b[1]
+ },
+ {
+ {
+ {1.0, 2.0, 3.0, 4.0}, // a[0][0]
+ {5.0, 6.0, 7.0, 8.0} // a[0][1]
+ }, // a[0]
+ {
+ {1.0, 2.0, 3.0, 4.0}, // a[1][0]
+ {5.0, 6.0, 7.0, 8.0} // a[1][1]
+ }, // a[1]
+ {
+ {1.0, 2.0, 3.0, 4.0}, // a[2][0]
+ {5.0, 6.0, 7.0, 8.0} // a[2][1]
+ } // a[2]
+ } // a
+ };
+
+ gl_Position = aggregate.a[2][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/initializer-struct-field-var-array-array.vert b/tests/spec/arb_arrays_of_arrays/compiler/initializer-struct-field-var-array-array.vert
new file mode 100644
index 0000000..72ccacf
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/initializer-struct-field-var-array-array.vert
@@ -0,0 +1,34 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * require_extensions: GL_ARB_shading_language_420pack
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+#extension GL_ARB_shading_language_420pack: enable
+
+void main()
+{
+ struct {
+ vec4 a[3][2];
+ } aggregate = {
+ {
+ {
+ {1.0, 2.0, 3.0, 4.0}, // a[0][0]
+ {5.0, 6.0, 7.0, 8.0} // a[0][1]
+ }, // a[0]
+ {
+ {1.0, 2.0, 3.0, 4.0}, // a[1][0]
+ {5.0, 6.0, 7.0, 8.0} // a[1][1]
+ }, // a[1]
+ {
+ {1.0, 2.0, 3.0, 4.0}, // a[2][0]
+ {5.0, 6.0, 7.0, 8.0} // a[2][1]
+ } // a[2]
+ }
+ };
+
+ gl_Position = aggregate.a[2][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/initializer-three-dimensions.vert b/tests/spec/arb_arrays_of_arrays/compiler/initializer-three-dimensions.vert
new file mode 100644
index 0000000..a0e06a6
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/initializer-three-dimensions.vert
@@ -0,0 +1,22 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * require_extensions: GL_ARB_shading_language_420pack
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+#extension GL_ARB_shading_language_420pack: enable
+
+void main()
+{
+ vec4 a[3][2][4] = {vec4[2][4](vec4[4](vec4(0.0), vec4(1.0), vec4(0.0), vec4(1.0)),
+ vec4[4](vec4(0.0), vec4(1.0), vec4(0.0), vec4(1.0))),
+ vec4[2][4](vec4[4](vec4(0.0), vec4(1.0), vec4(0.0), vec4(1.0)),
+ vec4[4](vec4(0.0), vec4(1.0), vec4(0.0), vec4(1.0))),
+ vec4[2][4](vec4[4](vec4(0.0), vec4(1.0), vec4(0.0), vec4(1.0)),
+ vec4[4](vec4(0.0), vec4(1.0), vec4(0.0), vec4(1.0)))};
+
+ gl_Position = a[2][1][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/initializer-three-dimensions2.vert b/tests/spec/arb_arrays_of_arrays/compiler/initializer-three-dimensions2.vert
new file mode 100644
index 0000000..57d355e
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/initializer-three-dimensions2.vert
@@ -0,0 +1,22 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * require_extensions: GL_ARB_shading_language_420pack
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+#extension GL_ARB_shading_language_420pack: enable
+
+void main()
+{
+ vec4 a[3][2][4] = {{vec4[4](vec4(0.0), vec4(1.0), vec4(0.0), vec4(1.0)),
+ vec4[4](vec4(0.0), vec4(1.0), vec4(0.0), vec4(1.0))},
+ {vec4[4](vec4(0.0), vec4(1.0), vec4(0.0), vec4(1.0)),
+ vec4[4](vec4(0.0), vec4(1.0), vec4(0.0), vec4(1.0))},
+ {vec4[4](vec4(0.0), vec4(1.0), vec4(0.0), vec4(1.0)),
+ vec4[4](vec4(0.0), vec4(1.0), vec4(0.0), vec4(1.0))}};
+
+ gl_Position = a[2][1][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/initializer-var-array-array.vert b/tests/spec/arb_arrays_of_arrays/compiler/initializer-var-array-array.vert
new file mode 100644
index 0000000..8a53cb7
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/initializer-var-array-array.vert
@@ -0,0 +1,19 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * require_extensions: GL_ARB_shading_language_420pack
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+#extension GL_ARB_shading_language_420pack: enable
+
+void main()
+{
+ vec4 a[3][2] = {vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0)),
+ vec4[2](vec4(0.0), vec4(1.0)) };
+
+ gl_Position = a[2][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/initializer-var-array-array2.vert b/tests/spec/arb_arrays_of_arrays/compiler/initializer-var-array-array2.vert
new file mode 100644
index 0000000..41fd76b
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/initializer-var-array-array2.vert
@@ -0,0 +1,19 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * require_extensions: GL_ARB_shading_language_420pack
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+#extension GL_ARB_shading_language_420pack: enable
+
+void main()
+{
+ vec4 a[3][2] = {{ vec4(0.0), vec4(1.0) },
+ { vec4(0.0), vec4(1.0) },
+ { vec4(0.0), vec4(1.0) }};
+
+ gl_Position = a[2][1];
+}
--
1.7.9.5
More information about the Piglit
mailing list