1 # This tests for a bug in loop unrolling where we were detecting 2 breaks in
2 # the loop but only found a single terminator (exit condition). The result was
3 # we were attempting to do a complex unroll but failing half way through the
4 # unroll process. As a result we ended up creating an infinite loop.
9 uniform int loop_break;
13 gl_Position = gl_Vertex;
17 for (int i = 0; i < 4; i++) {
19 colour = vec4(0.0, 1.0, 0.0, 1.0);
22 j++; // we use this so the if doesn't get reduced to a series of bcsel
23 if (loop_break == 1 || j == loop_break) {
24 colour = vec4(1.0, 0.0, 0.0, 1.0);
30 gl_FrontColor = colour;
36 gl_FragColor = gl_Color;
40 clear color 0.5 0.5 0.5 0.5
42 uniform int loop_break 0
44 probe all rgba 0.0 1.0 0.0 1.0
46 uniform int loop_break 1
48 probe all rgba 1.0 0.0 0.0 1.0