perf/pixel-rate: new pixel throughput microbenchmark
[piglit.git] / tests / spec / glsl-1.10 / execution / fs-discard-deep-branch.shader_test
blob63be51b135e638e16058d811a60a3c4a770c9c2e
1 # This tests discard in nested if-statements. The additional code in the outer
2 # if-statement caused this to miscompile in Mesa.
4 [require]
5 GLSL >= 1.10
6 SIZE 20 20
8 [vertex shader passthrough]
10 [fragment shader]
11 uniform bool use_discard;
12 uniform float boundary;
13 uniform vec4 color;
15 void main()
17         if (use_discard) {
18                 float tmp;
19                 tmp = boundary * 0.5;
20                 if (gl_FragCoord.x < tmp)
21                         discard;
22         }
24         gl_FragColor = color;
27 [test]
28 clear color 1.0 0.0 0.0 1.0
29 clear
31 uniform uint use_discard 1
32 uniform float boundary 20.0
33 uniform vec4 color 0.0 1.0 0.0 1.0
35 draw rect -1 -1 2 2
36 probe rect rgba (0, 0, 10, 20) (1.0, 0.0, 0.0, 1.0)
37 probe rect rgba (10, 0, 10, 20) (0.0, 1.0, 0.0, 1.0)
39 uniform uint use_discard 0
40 uniform vec4 color 0.0 0.0 1.0 1.0
41 draw rect -1 -1 2 2
42 probe all rgba 0.0 0.0 1.0 1.0