new file mode 100644
@@ -0,0 +1,29 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ *
+ * From page 18 (page 24 of the PDF) of the GLSL 1.20 spec:
+ *
+ * "Member declarators can contain arrays. Such arrays must have a size
+ * specified, and the size must be an integral constant expression that's
+ * greater than zero (see Section 4.3.3 "Constant Expressions")."
+ *
+ * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec:
+ *
+ * "All basic types and structures can be formed into arrays."
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+struct s {
+ float x[3][2];
+ int y;
+};
+
+void main()
+{
+ s a[2][4];
+ gl_Position = vec4(a.length() + a[0][0].x.length());
+}
new file mode 100644
@@ -0,0 +1,18 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.50
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 150
+#extension GL_ARB_arrays_of_arrays: enable
+
+uniform ArraysOfArraysBlock
+{
+ vec4 [3][2]a;
+} i;
+
+void main()
+{
+ gl_Position = vec4(1.0);
+}
new file mode 100644
@@ -0,0 +1,18 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.50
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 150
+#extension GL_ARB_arrays_of_arrays: enable
+
+uniform ArraysOfArraysBlock
+{
+ vec4[2] a[3];
+} i;
+
+void main()
+{
+ gl_Position = vec4(1.0);
+}
new file mode 100644
@@ -0,0 +1,18 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.50
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 150
+#extension GL_ARB_arrays_of_arrays: enable
+
+in ArraysOfArraysBlock
+{
+ vec4 [3][2]a;
+} i[];
+
+void main()
+{
+ gl_Position = i[0].a[2][1];
+}
new file mode 100644
@@ -0,0 +1,18 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.50
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 150
+#extension GL_ARB_arrays_of_arrays: enable
+
+in ArraysOfArraysBlock
+{
+ vec4[2] a[3];
+} i[];
+
+void main()
+{
+ gl_Position = i[0].a[2][1];
+}
new file mode 100644
@@ -0,0 +1,18 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.50
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 150
+#extension GL_ARB_arrays_of_arrays: enable
+
+in ArraysOfArraysBlock
+{
+ vec4 a[3][2];
+} i[];
+
+void main()
+{
+ gl_Position = i[0].a[2][1];
+}
new file mode 100644
@@ -0,0 +1,18 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.50
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 150
+#extension GL_ARB_arrays_of_arrays: enable
+
+in ArraysOfArraysBlock
+{
+ vec4 [3][2]a;
+} i[];
+
+void main()
+{
+ gl_Position = i[0].a[2][2];
+}
new file mode 100644
@@ -0,0 +1,18 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.50
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 150
+#extension GL_ARB_arrays_of_arrays: enable
+
+in ArraysOfArraysBlock
+{
+ vec4[2] a[3];
+} i[];
+
+void main()
+{
+ gl_Position = i[0].a[3][1];
+}
new file mode 100644
@@ -0,0 +1,18 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.50
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 150
+#extension GL_ARB_arrays_of_arrays: enable
+
+in ArraysOfArraysBlock
+{
+ vec4 a[3][2];
+} i[];
+
+void main()
+{
+ gl_Position = i[0].a[3][1];
+}
new file mode 100644
@@ -0,0 +1,18 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.50
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 150
+#extension GL_ARB_arrays_of_arrays: enable
+
+uniform ArraysOfArraysBlock
+{
+ vec4 a[3][2];
+} i;
+
+void main()
+{
+ gl_Position = vec4(1.0);
+}
new file mode 100644
@@ -0,0 +1,18 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.50
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 150
+#extension GL_ARB_arrays_of_arrays: enable
+
+uniform ArraysOfArraysBlock
+{
+ vec4 a;
+} i[4][5];
+
+void main()
+{
+ gl_Position = i[3][4].a;
+}
new file mode 100644
@@ -0,0 +1,18 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.50
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 150
+#extension GL_ARB_arrays_of_arrays: enable
+
+uniform ArraysOfArraysBlock
+{
+ vec4 a;
+} i[4][5];
+
+void main()
+{
+ gl_Position = i[3][5].a;
+}
new file mode 100644
@@ -0,0 +1,18 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.50
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 150
+#extension GL_ARB_arrays_of_arrays: enable
+
+uniform ArraysOfArraysBlock
+{
+ mat4 a;
+} i[4][5];
+
+void main()
+{
+ gl_Position = vec4(1.0);
+}
new file mode 100644
@@ -0,0 +1,19 @@
+/* [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[3][2] x;
+};
+
+uniform S s;
+
+void main()
+{
+ gl_FragData[0] = s.x[2][1];
+}
new file mode 100644
@@ -0,0 +1,19 @@
+/* [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];
+};
+
+uniform S s;
+
+void main()
+{
+ gl_FragData[0] = s.x[0][1];
+}
new file mode 100644
@@ -0,0 +1,19 @@
+/* [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];
+};
+
+uniform S s;
+
+void main()
+{
+ gl_FragData[0] = s.x[1][2];
+}
Test results are from the following hardware/driver combinations: AMD Radeon HD 6670 - Catalyst 13.251 OpenGL 4.3 Nvidia GeForce 210 - NVIDIA 331.20 OpenGL 3.3 Intel Ivy Bridge - Mesa 10.1(815e064) with ARB_arrays_of_arrays enabled arrays-of-struct-with-field-arrays.vert AMD: pass Nvida: pass Intel: pass interface-field-array-array-var.vert AMD: pass Nvida: pass Intel: pass interface-field-array-var-array.vert AMD: pass Nvida: pass Intel: pass interface-field-maxbounds-access-array-array-var.geom AMD: pass Nvida: pass Intel: pass interface-field-maxbounds-access-array-var-array.geom AMD: pass Nvida: pass Intel: pass interface-field-maxbounds-access-var-array-array.geom AMD: pass Nvida: pass Intel: pass interface-field-outofbounds-access-array-array-var.geom AMD: pass Nvida: fail (Nvidia only warns for outofbounds) Intel: pass interface-field-outofbounds-access-array-var-array.geom AMD: pass Nvida: fail (Nvidia only warns for outofbounds) Intel: pass interface-field-outofbounds-access-var-array-array.geom AMD: pass Nvida: fail (Nvidia only warns for outofbounds) Intel: pass interface-field-var-array-array.vert AMD: pass Nvida: pass Intel: pass interface-maxbounds.vert AMD: pass Nvida: pass Intel: crash interface-outofbounds.vert AMD: pass Nvida: fail (Nvidia only warns for outofbounds) Intel: pass interface.vert AMD: pass Nvida: pass Intel: pass structure-field-array-array-var.frag AMD: pass Nvida: pass Intel: pass structure-field-array-var-array.frag AMD: pass Nvida: pass Intel: pass structure-field-var-array-array.frag AMD: pass Nvida: pass Intel: pass Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au> --- .../arrays-of-struct-with-field-arrays.vert | 29 ++++++++++++++++++++++ .../compiler/interface-field-array-array-var.vert | 18 ++++++++++++++ .../compiler/interface-field-array-var-array.vert | 18 ++++++++++++++ ...ace-field-maxbounds-access-array-array-var.geom | 18 ++++++++++++++ ...ace-field-maxbounds-access-array-var-array.geom | 18 ++++++++++++++ ...ace-field-maxbounds-access-var-array-array.geom | 18 ++++++++++++++ ...e-field-outofbounds-access-array-array-var.geom | 18 ++++++++++++++ ...e-field-outofbounds-access-array-var-array.geom | 18 ++++++++++++++ ...e-field-outofbounds-access-var-array-array.geom | 18 ++++++++++++++ .../compiler/interface-field-var-array-array.vert | 18 ++++++++++++++ .../compiler/interface-maxbounds.vert | 18 ++++++++++++++ .../compiler/interface-outofbounds.vert | 18 ++++++++++++++ .../arb_arrays_of_arrays/compiler/interface.vert | 18 ++++++++++++++ .../compiler/structure-field-array-array-var.frag | 19 ++++++++++++++ .../compiler/structure-field-array-var-array.frag | 19 ++++++++++++++ .../compiler/structure-field-var-array-array.frag | 19 ++++++++++++++ 16 files changed, 302 insertions(+) create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/arrays-of-struct-with-field-arrays.vert create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/interface-field-array-array-var.vert create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/interface-field-array-var-array.vert create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/interface-field-maxbounds-access-array-array-var.geom create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/interface-field-maxbounds-access-array-var-array.geom create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/interface-field-maxbounds-access-var-array-array.geom create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/interface-field-outofbounds-access-array-array-var.geom create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/interface-field-outofbounds-access-array-var-array.geom create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/interface-field-outofbounds-access-var-array-array.geom create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/interface-field-var-array-array.vert create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/interface-maxbounds.vert create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/interface-outofbounds.vert create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/interface.vert create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/structure-field-array-array-var.frag create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/structure-field-array-var-array.frag create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/structure-field-var-array-array.frag