[Piglit] [PATCH 2/2] arb_arrays_of_arrays: linker intrastage tests

Timothy Arceri t_arceri at yahoo.com.au
Thu Dec 4 13:35:09 PST 2014


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 at 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

diff --git a/tests/spec/arb_arrays_of_arrays/linker/intrastage-dimension-size-mismatch.shader_test b/tests/spec/arb_arrays_of_arrays/linker/intrastage-dimension-size-mismatch.shader_test
new file mode 100644
index 0000000..4914ebc
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/linker/intrastage-dimension-size-mismatch.shader_test
@@ -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
diff --git a/tests/spec/arb_arrays_of_arrays/linker/intrastage-interface-field.shader_test b/tests/spec/arb_arrays_of_arrays/linker/intrastage-interface-field.shader_test
new file mode 100644
index 0000000..dc460d9
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/linker/intrastage-interface-field.shader_test
@@ -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
diff --git a/tests/spec/arb_arrays_of_arrays/linker/intrastage-interface.shader_test b/tests/spec/arb_arrays_of_arrays/linker/intrastage-interface.shader_test
new file mode 100644
index 0000000..1569781
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/linker/intrastage-interface.shader_test
@@ -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
diff --git a/tests/spec/arb_arrays_of_arrays/linker/intrastage-struct-field.shader_test b/tests/spec/arb_arrays_of_arrays/linker/intrastage-struct-field.shader_test
new file mode 100644
index 0000000..5c4220f
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/linker/intrastage-struct-field.shader_test
@@ -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
diff --git a/tests/spec/arb_arrays_of_arrays/linker/intrastage-struct.shader_test b/tests/spec/arb_arrays_of_arrays/linker/intrastage-struct.shader_test
new file mode 100644
index 0000000..2e31586
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/linker/intrastage-struct.shader_test
@@ -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
diff --git a/tests/spec/arb_arrays_of_arrays/linker/intrastage-unsized-mismatch.shader_test b/tests/spec/arb_arrays_of_arrays/linker/intrastage-unsized-mismatch.shader_test
new file mode 100644
index 0000000..711e277
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/linker/intrastage-unsized-mismatch.shader_test
@@ -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
diff --git a/tests/spec/arb_arrays_of_arrays/linker/intrastage-unsized-mismatch2.shader_test b/tests/spec/arb_arrays_of_arrays/linker/intrastage-unsized-mismatch2.shader_test
new file mode 100644
index 0000000..a2b86df
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/linker/intrastage-unsized-mismatch2.shader_test
@@ -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
diff --git a/tests/spec/arb_arrays_of_arrays/linker/intrastage-unsized.shader_test b/tests/spec/arb_arrays_of_arrays/linker/intrastage-unsized.shader_test
new file mode 100644
index 0000000..75b3133
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/linker/intrastage-unsized.shader_test
@@ -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
diff --git a/tests/spec/arb_arrays_of_arrays/linker/intrastage.shader_test b/tests/spec/arb_arrays_of_arrays/linker/intrastage.shader_test
new file mode 100644
index 0000000..8fa4f88
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/linker/intrastage.shader_test
@@ -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
-- 
1.9.3



More information about the Piglit mailing list