new file mode 100644
@@ -0,0 +1,36 @@
+# This test verifies that a link error is generated if intrastage
+# array sizes don't match.
+
+[require]
+GLSL >= 1.20
+GL_ARB_arrays_of_arrays
+
+[vertex shader]
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+varying vec4 color[4][2];
+
+void f()
+{
+ color[2][1] = vec4(1, 0, 0, 1);
+}
+
+[vertex shader]
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+varying vec4 color[3][2];
+
+void f();
+
+void main()
+{
+ f();
+ color[1][1] = vec4(1, 0, 0, 1);
+
+ gl_Position = gl_Vertex;
+}
+
+[test]
+link error
new file mode 100644
@@ -0,0 +1,38 @@
+# This test verifies that linking is successful if intrastage
+# array sizes match.
+
+[require]
+GLSL >= 1.50
+GL_ARB_arrays_of_arrays
+
+[vertex shader]
+#version 150
+#extension GL_ARB_arrays_of_arrays: enable
+
+out blk {
+ vec4 foo[2][5];
+} inst;
+
+void f()
+{
+ inst.foo[1][4] = vec4(1.0);
+}
+
+[vertex shader]
+#version 150
+#extension GL_ARB_arrays_of_arrays: enable
+
+out blk {
+ vec4 foo[2][5];
+} inst;
+
+void f();
+
+void main()
+{
+ f();
+ inst.foo[0][4] = vec4(1.0);
+}
+
+[test]
+link success
new file mode 100644
@@ -0,0 +1,38 @@
+# This test verifies that linking is successful if intrastage
+# array sizes match.
+
+[require]
+GLSL >= 1.50
+GL_ARB_arrays_of_arrays
+
+[vertex shader]
+#version 150
+#extension GL_ARB_arrays_of_arrays: enable
+
+out blk {
+ vec4 foo;
+} inst[2][5];
+
+void f()
+{
+ inst[1][4].foo = vec4(1.0);
+}
+
+[vertex shader]
+#version 150
+#extension GL_ARB_arrays_of_arrays: enable
+
+out blk {
+ vec4 foo;
+} inst[2][5];
+
+void f();
+
+void main()
+{
+ f();
+ inst[0][4].foo = vec4(1.0);
+}
+
+[test]
+link success
new file mode 100644
@@ -0,0 +1,42 @@
+# This test verifies that linking is successful if intrastage
+# array sizes match.
+
+[require]
+GLSL >= 1.20
+GL_ARB_arrays_of_arrays
+
+[vertex shader]
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+struct S {
+ vec4 [2] x[2];
+};
+
+uniform S s;
+varying vec4 color;
+
+void f()
+{
+ color = s.x[1][0];
+}
+
+[vertex shader]
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+struct S {
+ vec4 [2] x[2];
+};
+
+uniform S s;
+varying vec4 color;
+
+void f();
+
+void main()
+{
+ f();
+ gl_Position = s.x[1][1];
+}
+
+[test]
+link success
new file mode 100644
@@ -0,0 +1,42 @@
+# This test verifies that linking is successful if intrastage
+# array sizes match.
+
+[require]
+GLSL >= 1.20
+GL_ARB_arrays_of_arrays
+
+[vertex shader]
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+struct S {
+ vec4 x[2];
+};
+
+uniform S s[2][2];
+varying vec4 color;
+
+void f()
+{
+ color = s[1][1].x[0];
+}
+
+[vertex shader]
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+struct S {
+ vec4 x[2];
+};
+
+uniform S s[2][2];
+varying vec4 color;
+
+void f();
+
+void main()
+{
+ f();
+ gl_Position = s[1][1].x[1];
+}
+
+[test]
+link success
new file mode 100644
@@ -0,0 +1,36 @@
+# This test verifies that a link error is generated if intrastage
+# array sizes don't match.
+
+[require]
+GLSL >= 1.20
+GL_ARB_arrays_of_arrays
+
+[vertex shader]
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+varying vec4 color[][2];
+
+void f()
+{
+ color[3][1] = vec4(1, 0, 0, 1);
+}
+
+[vertex shader]
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+varying vec4 color[3][2];
+
+void f();
+
+void main()
+{
+ f();
+ color[1][1] = vec4(1, 0, 0, 1);
+
+ gl_Position = gl_Vertex;
+}
+
+[test]
+link error
new file mode 100644
@@ -0,0 +1,36 @@
+# This test verifies that a link error is generated if intrastage
+# array sizes don't match.
+
+[require]
+GLSL >= 1.20
+GL_ARB_arrays_of_arrays
+
+[vertex shader]
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+varying vec4 color[3][2];
+
+void f()
+{
+ color[1][1] = vec4(1, 0, 0, 1);
+}
+
+[vertex shader]
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+varying vec4 color[][2];
+
+void f();
+
+void main()
+{
+ f();
+ color[3][1] = vec4(1, 0, 0, 1);
+
+ gl_Position = gl_Vertex;
+}
+
+[test]
+link error
new file mode 100644
@@ -0,0 +1,36 @@
+# This test verifies that linking is successful if intrastage
+# array sizes match.
+
+[require]
+GLSL >= 1.20
+GL_ARB_arrays_of_arrays
+
+[vertex shader]
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+varying vec4 color[][2];
+
+void f()
+{
+ color[2][1] = vec4(1, 0, 0, 1);
+}
+
+[vertex shader]
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+varying vec4 color[3][2];
+
+void f();
+
+void main()
+{
+ f();
+ color[1][1] = vec4(1, 0, 0, 1);
+
+ gl_Position = gl_Vertex;
+}
+
+[test]
+link success
new file mode 100644
@@ -0,0 +1,44 @@
+# This test verifies that linking is successful if intrastage
+# array sizes match.
+
+[require]
+GLSL >= 1.20
+GL_ARB_arrays_of_arrays
+
+[vertex shader]
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+varying vec4 color[3][2];
+varying vec3 colour[4][2];
+varying vec4[4] c[2];
+
+void f()
+{
+ color[2][1] = vec4(1, 0, 0, 1);
+ colour[1][1] = vec3(2, 0, 0);
+ c[1][3] = vec4(4, 0, 0, 4);
+}
+
+[vertex shader]
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+varying vec4 color[3][2];
+varying vec3 colour[4][2];
+varying vec4[4] c[2];
+
+void f();
+
+void main()
+{
+ f();
+ color[1][1] = vec4(1, 0, 0, 1);
+ colour[3][1] = vec3(2, 0, 0);
+ c[1][0] = vec4(4, 0, 0, 4);
+
+ gl_Position = gl_Vertex;
+}
+
+[test]
+link success
Test results: AMD Radeon HD 6670 - Catalyst 13.251 OpenGL 4.3 intrastage-dimension-size-mismatch.shader_test AMD: pass intrastage-interface-field.shader_test AMD: pass intrastage-interface.shader_test AMD: pass intrastage-struct-field.shader_test AMD: pass intrastage-struct.shader_test AMD: pass intrastage-unsized-mismatch.shader_test AMD: pass intrastage-unsized-mismatch2.shader_test AMD: pass intrastage-unsized.shader_test AMD: pass intrastage.shader_test AMD: pass Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au> --- These tests lead me to finding a bug with single dimension arrays in Mesa so I'm pretty happy with the coverage. .../intrastage-dimension-size-mismatch.shader_test | 36 ++++++++++++++++++ .../linker/intrastage-interface-field.shader_test | 38 +++++++++++++++++++ .../linker/intrastage-interface.shader_test | 38 +++++++++++++++++++ .../linker/intrastage-struct-field.shader_test | 42 +++++++++++++++++++++ .../linker/intrastage-struct.shader_test | 42 +++++++++++++++++++++ .../linker/intrastage-unsized-mismatch.shader_test | 36 ++++++++++++++++++ .../intrastage-unsized-mismatch2.shader_test | 36 ++++++++++++++++++ .../linker/intrastage-unsized.shader_test | 36 ++++++++++++++++++ .../linker/intrastage.shader_test | 44 ++++++++++++++++++++++ 9 files changed, 348 insertions(+) create mode 100644 tests/spec/arb_arrays_of_arrays/linker/intrastage-dimension-size-mismatch.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/linker/intrastage-interface-field.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/linker/intrastage-interface.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/linker/intrastage-struct-field.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/linker/intrastage-struct.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/linker/intrastage-unsized-mismatch.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/linker/intrastage-unsized-mismatch2.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/linker/intrastage-unsized.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/linker/intrastage.shader_test