1 # This test exercises a bug in mesa as of 5/19/12: constant
2 # propagation fails to detect that array indexing into a vector might
3 # kill any component of the vector.
8 #define RED vec4(1.0, 0.0, 0.0, 0.0)
9 #define GREEN vec4(0.0, 1.0, 0.0, 0.0)
16 gl_Position = gl_Vertex;
18 vec4 v = vec4(1.0, 2.0, 3.0, 4.0);
20 // If the bug is present, constant propagation will see a scalar on
21 // the RHS, and incorrectly conclude that therefore only v.x is
25 vec4 color = v.a == 5.0 ? GREEN : RED;
27 // If the bug is present, then index and new_value will be optimized
28 // away, making shader_runner fail to assign uniforms. To avoid
29 // that, multiply color by (five - three - 1.0).
30 gl_FrontColor = color * (five - float(three) - 1.0);
36 gl_FragColor = gl_Color;
41 uniform float five 5.0
43 probe all rgba 0.0 1.0 0.0 0.0