[Piglit] [PATCH] glsl-1.20: Add tests exposing some crashes with double indirection

Chris Forbes chrisf at ijw.co.nz
Fri Nov 7 09:28:37 PST 2014


I stumbled across these while implementing tessellation. In particular,
the first test is a cutdown version of the tessellation nop.shader_test.

Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
---
 tests/all.py                                       |  4 ++++
 .../glsl-1.20/linker/double-indirect-1.shader_test | 25 ++++++++++++++++++++++
 .../glsl-1.20/linker/double-indirect-2.shader_test | 21 ++++++++++++++++++
 3 files changed, 50 insertions(+)
 create mode 100644 tests/spec/glsl-1.20/linker/double-indirect-1.shader_test
 create mode 100644 tests/spec/glsl-1.20/linker/double-indirect-2.shader_test

diff --git a/tests/all.py b/tests/all.py
index 4089325..3f004ce 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -1074,6 +1074,10 @@ spec['glsl-1.20']['execution'] = {}
 add_shader_test_dir(spec['glsl-1.20']['execution'],
                     os.path.join(testsDir, 'spec', 'glsl-1.20', 'execution'),
                     recursive=True)
+spec['glsl-1.20']['linker'] = {}
+add_shader_test_dir(spec['glsl-1.20']['linker'],
+                    os.path.join(testsDir, 'spec', 'glsl-1.20', 'linker'),
+                    recursive=True)
 add_shader_test_dir(spec['glsl-1.20']['execution'],
                     os.path.join(generatedTestDir, 'spec', 'glsl-1.20', 'execution'),
                     recursive=True)
diff --git a/tests/spec/glsl-1.20/linker/double-indirect-1.shader_test b/tests/spec/glsl-1.20/linker/double-indirect-1.shader_test
new file mode 100644
index 0000000..e55170e
--- /dev/null
+++ b/tests/spec/glsl-1.20/linker/double-indirect-1.shader_test
@@ -0,0 +1,25 @@
+# Demonstrates a crash in mesa. The double indirection via const arrays
+# is required to trigger this.
+
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+
+const vec2 verts[] = vec2[](vec2(-1, 1),
+                            vec2(-1, -1),
+                            vec2(1, -1),
+                            vec2(1, 1));
+const int elts[] = int[](0, 1, 2,
+                         0, 2, 3);
+
+uniform int n;
+
+void main()
+{
+  gl_Position = vec4(verts[elts[n]], 0, 1);
+}
+
+[test]
+link success
diff --git a/tests/spec/glsl-1.20/linker/double-indirect-2.shader_test b/tests/spec/glsl-1.20/linker/double-indirect-2.shader_test
new file mode 100644
index 0000000..c1d46e3
--- /dev/null
+++ b/tests/spec/glsl-1.20/linker/double-indirect-2.shader_test
@@ -0,0 +1,21 @@
+# Demonstrates a crash in i965. The double indirection via const arrays
+# is required to trigger this.
+
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+
+const float a[] = float[](0);
+const int b[] = int[](0);
+
+uniform int n;
+
+void main()
+{
+  gl_Position = vec4(a[b[n]], 0, 0, 1);
+}
+
+[test]
+link success
-- 
2.1.3



More information about the Piglit mailing list