# Left side should be green, and the right side should be gray. In the bug # case, both slides will be slightly different shades of green. # # If WORK_AROUND is defined in the vertex shader, correct results are produced. [require] GLSL >= 1.20 [vertex shader] #version 120 //#define WORK_AROUND attribute vec4 vertex; uniform bool flag; uniform float contrast; varying vec4 color; vec4 gray = vec4(0.4, 0.4, 0.4, #ifndef WORK_AROUND contrast #else 1.0 #endif ); vec4 orange = vec4(1.0, 0.72, 0.0, #ifndef WORK_AROUND contrast #else 1.0 #endif ); void main() { color = gray; // Changing this to !flag doesn't affect the output of the test. if (flag) color = orange; #ifdef WORK_AROUND color.w = contrast; #endif gl_Position = vertex; } [fragment shader] varying vec4 color; void main() { // Swizzle the W around to get gray or green. gl_FragColor = color.wyzw; } [test] uniform int flag 1 uniform float contrast 0.1 draw rect -1 -1 1 2 uniform int flag 0 uniform float contrast 0.4 draw rect 0 -1 1 2