progs/vpglsl/vp-tris if.glsl has: void main() { gl_FrontColor = gl_Color; gl_Position = gl_Vertex; if (gl_Position.x < 0.5) gl_FrontColor = vec4(1.0, 0.0, 0.0, 1.0); } This compiles to mesa_program: # Vertex Program/Shader 3 0: MOV OUTPUT[1], INPUT[3]; 1: MOV TEMP[0], INPUT[0]; 2: SLT.C TEMP[0].x, INPUT[0].xxxx, CONST[0].xxxx; 3: IF (NE.xxxx); # (if false, goto 5); 4: MOV OUTPUT[1], CONST[1]; 5: ENDIF; 6: MOV OUTPUT[0], TEMP[0]; 7: END From what I understand TEMP[0].x is overwritten in 2: SLT.C and this is then output as gl_position.x - this is not what the shader code above does. Seems due to this it currently misrenders on r600 and also intel also same thing with ifelse.glsl nestedifs.glsl ...
Fixed on the Mesa 7.6 branch with commit 5076a4f53a2f34cc9116b45951037f639885c7a1. However, I think there's another bug related to this in Mesa 7.7 and later...
False alarm on the secondary bug. The code was wrong (an extraneous loop in _mesa_remove_output_reads(), but the results were correct anyway. Closing this bug.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.