summaryrefslogtreecommitdiff
path: root/tests/shaders/glsl-texcoord-array.shader_test
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-07-07 14:17:14 -0700
committerEric Anholt <eric@anholt.net>2010-07-13 16:26:16 -0700
commitc29c45f21eef7378e1c93cef8ac452e65c1ec6f8 (patch)
tree1df9cbe748f70d16ed3e1f0f5d7c4c464c459043 /tests/shaders/glsl-texcoord-array.shader_test
parentc829d7cf9af7d1f1b9c36dc7aa4d0529c7f8143b (diff)
glsl-texcoord-array: Fix to be valid GLSL I hope.
Notably, there are no implicit conversions from float to int for array indices, though Mesa master does so. Just use int uniforms, and use 1.20 to get the implicit conversion from int to float for the multiplication.
Diffstat (limited to 'tests/shaders/glsl-texcoord-array.shader_test')
-rw-r--r--tests/shaders/glsl-texcoord-array.shader_test11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/shaders/glsl-texcoord-array.shader_test b/tests/shaders/glsl-texcoord-array.shader_test
index 26de8bb3b..d1a1fd8f9 100644
--- a/tests/shaders/glsl-texcoord-array.shader_test
+++ b/tests/shaders/glsl-texcoord-array.shader_test
@@ -1,9 +1,10 @@
[require]
GL >= 2.0
-GLSL >= 1.10
+GLSL >= 1.20
[vertex shader]
-uniform float n;
+#version 120
+uniform int n;
void main()
{
for (int i = 0; i < n; i++) {
@@ -13,14 +14,14 @@ void main()
}
[fragment shader]
-uniform float index;
+uniform int index;
void main()
{
gl_FragColor = gl_TexCoord[index];
}
[test]
-uniform float index 1
-uniform float n 4.0
+uniform int index 1
+uniform int n 4
draw rect -1 -1 2 2
probe rgba 1 1 0.5 0.5 0.5 0.5