glsl-array-bounds: set out-of-bounds array index inside shader
[piglit.git] / tests / shaders / glsl-vs-channel-overwrite-01.shader_test
blob9fb3da51c5e5501d33bf846e2e04853aac8e0194
1 [require]
2 GLSL >= 1.20
4 [vertex shader]
5 #version 120
6 attribute vec3 vertex;
7 uniform mat4 mvp = mat4(1.);
9 void main()
11     vec4 tmp;
13     /* These two blocks of code should produce the same result, but for some
14      * reason the tmp[3] assignment in the first version gets eliminated by
15      * one of Mesa's optimization passes.
16      */
17 #if 1
18     tmp[3] = 1.0;
19     tmp.xyz = vertex;
20 #else
21     tmp.w = 1.0;
22     tmp.xyz = vertex;
23 #endif
24     gl_Position = mvp * tmp;
27 [fragment shader]
28 void main()
30     gl_FragColor = vec4(0., 1., 0., 1.);
33 [vertex data]
34 vertex/float/3
35  1.0  1.0  1.0
36 -1.0  1.0  1.0
37 -1.0 -1.0  1.0
38  1.0 -1.0  1.0
40 [test]
41 draw arrays GL_TRIANGLE_FAN 0 4
42 relative probe rgb (.5, .5) (0.0, 1.0, 0.0)