perf/pixel-rate: new pixel throughput microbenchmark
[piglit.git] / tests / spec / glsl-1.10 / execution / fs-max-of-neg-min.shader_test
blob950f0cc42f144947e6c83d174c44671298bca3e0
1 # Attempts to recreate a a bug in an algebraic optimization added in
2 # 07cd30ca293 ("nir/opt_algebraic: optimize fmax(-fmin(b, a), b) ->
3 # fmax(b, -a)"
4 [require]
5 GLSL >= 1.10
7 [vertex shader passthrough]
9 [fragment shader]
11 uniform float a;
12 uniform float b;
14 void main()
16         float c = max(-min(a, b), b);
18         // The wrong answer for the bug this is trying to reproduce is -15.
19         // For that specific case, the test will produce medium (15/35) green.
20         if (c <= 0.0 || c > 35.0)
21                 gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
22         else
23                 gl_FragColor = vec4(0.0, c / 35.0 , 0.0, 1.0);
26 [test]
27 clear color 0.2 0.2 0.2 0.2
28 clear
30 uniform float a 15.0
31 uniform float b -35.0
33 draw rect -1 -1 2 2
34 probe all rgba 0.0 1.0 0.0 1.0