[Piglit] [PATCH 2/4] glsl-vs-uniform-array-3: New test for variable array access with 2 arrays.

Eric Anholt eric at anholt.net
Wed Sep 7 12:24:50 PDT 2011


While we have great coverage of various kinds of variable indexed
access within an array, we apparently lacked anything using 2 arrays
at once in GLSL.  Caught a bug in i965.
---
 tests/shaders/glsl-vs-uniform-array-3.shader_test |   39 +++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 deletions(-)
 create mode 100644 tests/shaders/glsl-vs-uniform-array-3.shader_test

diff --git a/tests/shaders/glsl-vs-uniform-array-3.shader_test b/tests/shaders/glsl-vs-uniform-array-3.shader_test
new file mode 100644
index 0000000..f7d1e64
--- /dev/null
+++ b/tests/shaders/glsl-vs-uniform-array-3.shader_test
@@ -0,0 +1,39 @@
+[require]
+GL >= 2.0
+GLSL >= 1.10
+
+[vertex shader]
+uniform vec4 arg0[4];
+uniform vec4 arg1[4];
+uniform int i, j;
+
+varying vec4 color;
+void main()
+{
+	gl_Position = gl_Vertex;
+	color = arg0[i] + arg1[j];
+}
+
+[fragment shader]
+varying vec4 color;
+void main()
+{
+	gl_FragColor = color;
+}
+
+[test]
+uniform vec4 arg0[0] 0.1 0.0 0.0 0.0
+uniform vec4 arg0[1] 0.0 0.2 0.0 0.0
+uniform vec4 arg0[2] 0.3 0.0 0.0 0.0
+uniform vec4 arg0[3] 0.4 0.0 0.0 0.0
+
+uniform vec4 arg1[0] 0.0 0.0 0.1 0.0
+uniform vec4 arg1[1] 0.0 0.0 0.2 0.0
+uniform vec4 arg1[2] 0.0 0.3 0.0 0.0
+uniform vec4 arg1[3] 0.0 0.0 0.4 0.0
+
+uniform int i 1
+uniform int j 2
+
+draw rect -1 -1 2 2
+probe all rgba 0.0 0.5 0.0 0.0
-- 
1.7.5.4



More information about the Piglit mailing list