[Piglit] [PATCH] shaders: add test for recursive variable indexing into arrays

Iago Toral Quiroga itoral at igalia.com
Thu Mar 3 08:31:28 UTC 2016


---
 ...l-recursive-variable-array-indexing.shader_test | 45 ++++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 tests/shaders/glsl-recursive-variable-array-indexing.shader_test

diff --git a/tests/shaders/glsl-recursive-variable-array-indexing.shader_test b/tests/shaders/glsl-recursive-variable-array-indexing.shader_test
new file mode 100644
index 0000000..40c838c
--- /dev/null
+++ b/tests/shaders/glsl-recursive-variable-array-indexing.shader_test
@@ -0,0 +1,45 @@
+# Tests recursive variable indexing into arrays
+# See https://bugs.freedesktop.org/show_bug.cgi?id=89607
+
+[require]
+GLSL >= 1.30
+
+[vertex shader]
+#version 130
+
+in vec4 piglit_vertex;
+out vec4 color;
+
+vec4 temps[3];
+vec4 temps3[3];
+
+void main()
+{
+	temps[0]  = vec4(1 , 0.50, 0.60, 0.90);
+	temps[1]  = vec4(2 , 0.30, 0.70, 0.90);
+	temps[2]  = vec4(0 , 0.15, 0.25, 0.90);
+
+	temps3[0] = vec4(1, 0.30, 0.40, 0.50);
+	temps3[1] = vec4(2, 0.40, 0.50 ,0.60);
+	temps3[2] = vec4(0, 0.50, 0.60, 0.70);
+
+        color = temps[int(temps3[int(temps[int(temps3[0].x)].x)].x)];
+
+	gl_Position = piglit_vertex;
+}
+
+[fragment shader]
+#version 130
+in vec4 color;
+void main()
+{
+	gl_FragColor = color;
+}
+
+[test]
+clear color 0.0 0.0 0.0 0.0
+clear
+ortho
+draw rect -1 -1 2 2
+probe rgba  2 2  1.0 0.5 0.6 0.9
+
-- 
1.9.1



More information about the Piglit mailing list