[Piglit] [PATCH] arb_arrays_of_arrays: linker tests

Timothy Arceri t_arceri at yahoo.com.au
Sat Nov 22 17:57:21 PST 2014


Test results:

AMD Radeon HD 6670 - Catalyst 13.251 OpenGL 4.3

vs-to-fs-dimension-size-mismatch.shader_test
AMD: crash

vs-to-fs-dimensions-mismatch.shader_test
AMD: crash

vs-to-fs-interface-field.shader_test
AMD: pass

vs-to-fs-interface.shader_test
AMD: pass

vs-to-fs-struct-field.shader_test
AMD: pass

vs-to-fs-struct.shader_test
AMD: pass

vs-to-fs-type-mismatch.shader_test
AMD: crash

vs-to-fs-unsized-mismatch.shader_test
AMD: fail

vs-to-fs-unsized.shader_test
AMD: pass

vs-to-fs.shader_test
AMD: pass

vs-to-gs-invalid-dimensions.shader_test
AMD: crash

vs-to-gs.shader_test
AMD: crash

Signed-off-by: Timothy Arceri <t_arceri at yahoo.com.au>
---

 I could do more negitive tests but it feels like this is really
 just testing the compile stage rather than linking.

 tests/all.py                                       |  3 ++
 .../vs-to-fs-dimension-size-mismatch.shader_test   | 31 +++++++++++++++++++
 .../vs-to-fs-dimensions-mismatch.shader_test       | 31 +++++++++++++++++++
 .../linker/vs-to-fs-interface-field.shader_test    | 34 ++++++++++++++++++++
 .../linker/vs-to-fs-interface.shader_test          | 34 ++++++++++++++++++++
 .../linker/vs-to-fs-struct-field.shader_test       | 36 ++++++++++++++++++++++
 .../linker/vs-to-fs-struct.shader_test             | 36 ++++++++++++++++++++++
 .../linker/vs-to-fs-type-mismatch.shader_test      | 31 +++++++++++++++++++
 .../linker/vs-to-fs-unsized-mismatch.shader_test   | 30 ++++++++++++++++++
 .../linker/vs-to-fs-unsized.shader_test            | 30 ++++++++++++++++++
 .../linker/vs-to-fs.shader_test                    | 36 ++++++++++++++++++++++
 .../linker/vs-to-gs-invalid-dimensions.shader_test | 36 ++++++++++++++++++++++
 .../linker/vs-to-gs.shader_test                    | 36 ++++++++++++++++++++++
 13 files changed, 404 insertions(+)
 create mode 100644 tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-dimension-size-mismatch.shader_test
 create mode 100644 tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-dimensions-mismatch.shader_test
 create mode 100644 tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-interface-field.shader_test
 create mode 100644 tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-interface.shader_test
 create mode 100644 tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-struct-field.shader_test
 create mode 100644 tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-struct.shader_test
 create mode 100644 tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-type-mismatch.shader_test
 create mode 100644 tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-unsized-mismatch.shader_test
 create mode 100644 tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-unsized.shader_test
 create mode 100644 tests/spec/arb_arrays_of_arrays/linker/vs-to-fs.shader_test
 create mode 100644 tests/spec/arb_arrays_of_arrays/linker/vs-to-gs-invalid-dimensions.shader_test
 create mode 100644 tests/spec/arb_arrays_of_arrays/linker/vs-to-gs.shader_test

diff --git a/tests/all.py b/tests/all.py
index ea652f4..ff3e0a4 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -1544,6 +1544,9 @@ 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'])
+add_shader_test_dir(arb_arrays_of_arrays,
+                    os.path.join(testsDir, 'spec', 'arb_arrays_of_arrays'),
+                    recursive=True)
 
 # Group AMD_shader_trinary_minmax
 spec['AMD_shader_trinary_minmax'] = {}
diff --git a/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-dimension-size-mismatch.shader_test b/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-dimension-size-mismatch.shader_test
new file mode 100644
index 0000000..2d69464
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-dimension-size-mismatch.shader_test
@@ -0,0 +1,31 @@
+# Test for linking error due to size mismatch between
+# vertex and fragment shaders
+
+[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 main()
+{
+  color[2][1] = vec4(1, 0, 0, 1);
+
+  gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+varying vec4 color[4][2];
+
+void main()
+{
+  gl_FragColor = color[2][1];
+}
+
+[test]
+link error
diff --git a/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-dimensions-mismatch.shader_test b/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-dimensions-mismatch.shader_test
new file mode 100644
index 0000000..4586fdb
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-dimensions-mismatch.shader_test
@@ -0,0 +1,31 @@
+# Test for linking error due to number of dimensions mismatch between
+# vertex and fragment shaders
+
+[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 main()
+{
+  color[2][1] = vec4(1, 0, 0, 1);
+
+  gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+varying vec4 color[2][3][2];
+
+void main()
+{
+  gl_FragColor = color[1][2][1];
+}
+
+[test]
+link error
diff --git a/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-interface-field.shader_test b/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-interface-field.shader_test
new file mode 100644
index 0000000..f9fe786
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-interface-field.shader_test
@@ -0,0 +1,34 @@
+# Test for successful linking of vertex and fragment shaders
+
+[require]
+GLSL >= 1.50
+GL_ARB_arrays_of_arrays
+
+[vertex shader]
+#version 150
+#extension GL_ARB_arrays_of_arrays: enable
+out ArraysOfArraysBlock
+{
+  vec4 a[3][2];
+} i;
+
+void main()
+{
+  gl_Position = vec4(1.0);
+}
+
+[fragment shader]
+#version 150
+#extension GL_ARB_arrays_of_arrays: enable
+in ArraysOfArraysBlock
+{
+  vec4 a[3][2];
+} i;
+
+void main()
+{
+  gl_FragColor = i.a[1][1];
+}
+
+[test]
+link success
diff --git a/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-interface.shader_test b/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-interface.shader_test
new file mode 100644
index 0000000..5cd3be0
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-interface.shader_test
@@ -0,0 +1,34 @@
+# Test for successful linking of vertex and fragment shaders
+
+[require]
+GLSL >= 1.50
+GL_ARB_arrays_of_arrays
+
+[vertex shader]
+#version 150
+#extension GL_ARB_arrays_of_arrays: enable
+out ArraysOfArraysBlock
+{
+  vec4 a;
+} i[4][5];
+
+void main()
+{
+  gl_Position = vec4(1.0);
+}
+
+[fragment shader]
+#version 150
+#extension GL_ARB_arrays_of_arrays: enable
+in ArraysOfArraysBlock
+{
+  vec4 a;
+} i[4][5];
+
+void main()
+{
+  gl_FragColor = i[1][1].a;
+}
+
+[test]
+link success
diff --git a/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-struct-field.shader_test b/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-struct-field.shader_test
new file mode 100644
index 0000000..15ead0f
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-struct-field.shader_test
@@ -0,0 +1,36 @@
+# Test for successful linking of vertex and fragment shaders
+
+[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;
+
+void main()
+{
+  gl_Position = vec4(1.0);
+}
+
+[fragment shader]
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+struct S {
+  vec4 [2] x[2];
+};
+
+uniform S s;
+
+void main()
+{
+  gl_FragColor = s.x[1][1];
+}
+
+[test]
+link success
diff --git a/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-struct.shader_test b/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-struct.shader_test
new file mode 100644
index 0000000..b2dd5df
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-struct.shader_test
@@ -0,0 +1,36 @@
+# Test for successful linking of vertex and fragment shaders
+
+[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];
+
+void main()
+{
+  gl_Position = vec4(1.0);
+}
+
+[fragment shader]
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+struct S {
+  vec4 x[2];
+};
+
+uniform S s[2][2];
+
+void main()
+{
+  gl_FragColor = s[1][1].x[1];
+}
+
+[test]
+link success
diff --git a/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-type-mismatch.shader_test b/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-type-mismatch.shader_test
new file mode 100644
index 0000000..cf023ce
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-type-mismatch.shader_test
@@ -0,0 +1,31 @@
+# Test for linking error due type mismatch between
+# vertex and fragment shaders
+
+[require]
+GLSL >= 1.20
+GL_ARB_arrays_of_arrays
+
+[vertex shader]
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+varying vec3 color[3][2];
+
+void main()
+{
+  color[2][1] = vec3(1, 0, 0);
+
+  gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+varying vec4 color[4][2];
+
+void main()
+{
+  gl_FragColor = color[2][1];
+}
+
+[test]
+link error
diff --git a/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-unsized-mismatch.shader_test b/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-unsized-mismatch.shader_test
new file mode 100644
index 0000000..c2dfc83
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-unsized-mismatch.shader_test
@@ -0,0 +1,30 @@
+# Test for error when linking vertex and fragment shaders
+
+[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 main()
+{
+  color[2][1] = vec4(1, 0, 0, 1);
+
+  gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+varying vec4 color[2][2];
+
+void main()
+{
+  gl_FragColor = color[1][1];
+}
+
+[test]
+link error
diff --git a/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-unsized.shader_test b/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-unsized.shader_test
new file mode 100644
index 0000000..c1c2508
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-unsized.shader_test
@@ -0,0 +1,30 @@
+# Test for successful linking of vertex and fragment shaders
+
+[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 main()
+{
+  color[2][1] = vec4(1, 0, 0, 1);
+
+  gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+varying vec4 color[3][2];
+
+void main()
+{
+  gl_FragColor = color[2][1];
+}
+
+[test]
+link success
diff --git a/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs.shader_test b/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs.shader_test
new file mode 100644
index 0000000..f336849
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs.shader_test
@@ -0,0 +1,36 @@
+# Test for successful linking of vertex and fragment shaders
+
+[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 main()
+{
+  color[2][1] = vec4(1, 0, 0, 1);
+  colour[1][1] = vec3(2, 0, 0);
+  c[1][3] = vec4(4, 0, 0, 4);
+
+  gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+varying vec4 color[3][2];
+varying vec3[2] colour[4];
+varying vec4 c[2][4];
+
+void main()
+{
+  gl_FragColor = color[2][1];
+}
+
+[test]
+link success
diff --git a/tests/spec/arb_arrays_of_arrays/linker/vs-to-gs-invalid-dimensions.shader_test b/tests/spec/arb_arrays_of_arrays/linker/vs-to-gs-invalid-dimensions.shader_test
new file mode 100644
index 0000000..610677f
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/linker/vs-to-gs-invalid-dimensions.shader_test
@@ -0,0 +1,36 @@
+# Test for error when linking vertex and geometry shaders
+
+[require]
+GLSL >= 1.50
+GL_ARB_arrays_of_arrays
+
+[vertex shader]
+#version 150
+#extension GL_ARB_arrays_of_arrays: enable
+
+out vec4 vertex_to_gs[2][4];
+
+void main()
+{
+  vertex_to_gs[1][3] = vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[geometry shader]
+#version 150
+#extension GL_ARB_arrays_of_arrays: enable
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+in vec4 vertex_to_gs[3][2];
+
+void main()
+{
+  for (int i = 0; i < 3; i++) {
+    gl_Position = vertex_to_gs[i][0];
+    EmitVertex();
+  }
+}
+
+[test]
+link error
diff --git a/tests/spec/arb_arrays_of_arrays/linker/vs-to-gs.shader_test b/tests/spec/arb_arrays_of_arrays/linker/vs-to-gs.shader_test
new file mode 100644
index 0000000..ee1dacc
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/linker/vs-to-gs.shader_test
@@ -0,0 +1,36 @@
+# Test for successful linking of vertex and geometry shaders
+
+[require]
+GLSL >= 1.50
+GL_ARB_arrays_of_arrays
+
+[vertex shader]
+#version 150
+#extension GL_ARB_arrays_of_arrays: enable
+
+out vec4 vertex_to_gs[2][4];
+
+void main()
+{
+  vertex_to_gs[1][3] = vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[geometry shader]
+#version 150
+#extension GL_ARB_arrays_of_arrays: enable
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+in vec4 vertex_to_gs[3][2][4];
+
+void main()
+{
+  for (int i = 0; i < 3; i++) {
+    gl_Position = vertex_to_gs[i][0][0];
+    EmitVertex();
+  }
+}
+
+[test]
+link success
-- 
1.9.3



More information about the Piglit mailing list