perf/pixel-rate: new pixel throughput microbenchmark
[piglit.git] / tests / spec / glsl-1.30 / execution / fs-modf-vec4.shader_test
blob9ffa33e7635828c4f8a82613633ba4937a56b39d
1 # Test proper behavior of the modf(vec4) function.
3 # test modf splits the input values into the two pieces and
4 # returns them correctly.
6 [require]
7 GLSL >= 1.30
9 [vertex shader]
10 #version 130
11 void main()
13   gl_Position = gl_Vertex;
16 [fragment shader]
17 #version 130
18 uniform vec4 value;
19 uniform vec4 expected1;
20 uniform vec4 expected2;
21 uniform float tolerance;
22 void main()
24   vec4 temp, tempi;
25   bool b1, b2;
26   temp = modf(value, tempi);
27   b1 = distance(tempi, expected1) < tolerance;
28   b2 = distance(temp, expected2) < tolerance;
29   gl_FragColor = vec4(b1, b2, 0.0, 1.0);
32 [test]
33 uniform vec4 value 1.5 0.5 2.5 0.0
34 uniform vec4 expected1 1.0 0.0 2.0 0.0
35 uniform vec4 expected2 0.5 0.5 0.5 0.0
36 uniform float tolerance 0.0041452078
37 draw rect -1 -1 2 2
38 probe rgba 0 0 1.0 1.0 0.0 1.0
40 uniform vec4 value -1.33 0.75 10.3333 100.865
41 uniform vec4 expected1 -1.0 0.0 10.0 100.0
42 uniform vec4 expected2 -0.33 0.75 0.3333 0.865
43 uniform float tolerance 0.0041452078
44 draw rect -1 -1 2 2
45 probe rgba 1 0 1.0 1.0 0.0 1.0