[Piglit] [PATCH] glsl-1.20: test intrastage linking with const arrays

Tapani Pälli tapani.palli at intel.com
Mon Mar 23 00:50:27 PDT 2015


Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
---
 .../linker/intrastage-const-arrays.shader_test     | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 tests/spec/glsl-1.20/linker/intrastage-const-arrays.shader_test

diff --git a/tests/spec/glsl-1.20/linker/intrastage-const-arrays.shader_test b/tests/spec/glsl-1.20/linker/intrastage-const-arrays.shader_test
new file mode 100644
index 0000000..d364358
--- /dev/null
+++ b/tests/spec/glsl-1.20/linker/intrastage-const-arrays.shader_test
@@ -0,0 +1,22 @@
+# Test linking two shaders which both have array of constants.
+# https://bugs.freedesktop.org/show_bug.cgi?id=89590
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+uniform int index;
+void main() {
+	const float zs[4] = float[4](0, 0, 0, 0);
+	gl_Position = vec4(zs[index]);
+}
+
+[fragment shader]
+uniform int index;
+void main()
+{
+	const vec4 colours[2] = vec4[2](vec4(1, 0, 0, 0), vec4(0, 1, 0, 0));
+	gl_FragColor = vec4(colours[index].x);
+}
+
+[test]
+link success
-- 
2.1.0



More information about the Piglit mailing list