Skip to content

glsl-1.10: remove undefined behaviour from loop test

Timothy Arceri requested to merge tarceri/piglit:fix_loop_test into master

From the glsl 1.10 spec:

"If subsequent fixed functionality consumes fragment color and an execution of afragment shader does not write a value to gl_FragColor then the fragment color consumed is undefined."

Since the first return results in an underfined gl_FragColor value and Mesa's NIR optimisations evaluate the while loops condition as being false both the loop and the first if statment end up being optimised away, this means the uniform u is now unused.

An upcoming NIR change will remove this unused uniform and cause this test to fail since it can't find it. To avoid this we remove the undefined behaviour from the test.

While we are here we move the test to a more appropriate location.

Merge request reports