glsl-array-bounds: set out-of-bounds array index inside shader
[piglit.git] / tests / shaders / glsl-vs-vectorize-between-basic-blocks-loop.shader_test
blob436aa788ffca3e6b034089c366f43ca515755ca7
1 # Tests that scalar operations in different basic blocks
2 # are not combined incorrectly into a vector operation.
4 # Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74113
6 [require]
7 GLSL >= 1.10
9 [vertex shader]
10 uniform int n;
11 uniform vec2 v;
13 attribute vec4 piglit_vertex;
14 varying vec2 color;
16 void main()
18     color = vec2(0.0);
20     for (int i = 0; i < n; i++) {
21         color.x += v.x;
22     }
23     color.y += v.y;
25     gl_Position = piglit_vertex;
28 [fragment shader]
29 varying vec2 color;
31 void main()
33   gl_FragColor = vec4(color, 0.0, 1.0);
36 [test]
37 uniform int n 3
38 uniform vec2 v 0.25 0.25
39 draw rect -1 -1 2 2
40 probe all rgba 0.75 0.25 0 1