perf/pixel-rate: new pixel throughput microbenchmark
[piglit.git] / tests / spec / glsl-1.10 / execution / glsl-fs-if-nested-loop.shader_test
blobfc5c85192991f3457d108cd3818d5e5c00d6998b
1 [require]
2 GLSL >= 1.10
4 [vertex shader]
5 varying vec4 color;
6 varying float x;
7 varying float y;
9 void main()
11         gl_Position = gl_Vertex;
12         x = gl_Vertex.x;
13         y = gl_Vertex.y;
16 [fragment shader]
17 varying float x;
18 varying float y;
20 void main()
22         if (x < 0.0) {
23                 gl_FragColor = vec4(0.0, 1.0, 0.0, 0.0);
24                 /* left */
25                 for (float f = -2.0; f < x; f++) {
26                         if (f != y + 5.0) /* always */
27                                 break;
28                         gl_FragColor += vec4(1.0, 0.0, 0.0, 0.0);
29                 }
30         } else {
31                 /* right */
32                 gl_FragColor = vec4(0.0, 1.0, 0.0, 0.0);
33         }
36 [test]
37 draw rect -1 -1 2 2
38 probe all rgba 0.0 1.0 0.0 0.0