perf/pixel-rate: new pixel throughput microbenchmark
[piglit.git] / tests / spec / glsl-1.30 / execution / fs-mix-bvec4-infnan.shader_test
blob58512a4522f2480d16602d032da76ddbb88f5cc6
1 # From the GLSL 1.30 spec:
3 #     Selects which vector each returned component comes
4 #     from. For a component of a that is false, the
5 #     corresponding component of x is returned. For a
6 #     component of a that is true, the corresponding
7 #     component of y is returned. Components of x and y that
8 #     are not selected are allowed to be invalid floating point
9 #     values and will have no effect on the results.
11 [require]
12 GLSL >= 1.30
14 [vertex shader]
15 #version 130
16 void main()
18         gl_Position = gl_Vertex;
21 [fragment shader]
22 #version 130
23 uniform float a, b, zero, one;
24 uniform bvec4 selector;
26 void main()
28         float inf = one / zero;
29         float nan = zero / zero;
31         vec4 arg0 = vec4(a, b, inf, nan);
32         vec4 arg1 = vec4(inf, nan, a, b);
34         gl_FragColor = mix(arg0, arg1, selector);
37 [test]
38 uniform float a 0.25
39 uniform float b 0.75;
40 uniform float zero 0.0
41 uniform float one 1.0
42 uniform ivec4 selector 0 0 1 1
44 draw rect -1 -1 2 2
45 probe all rgba 0.25 0.75 0.25 0.75