perf/pixel-rate: new pixel throughput microbenchmark
[piglit.git] / tests / spec / glsl-1.10 / execution / glsl-sdl-sincos-accuracy.shader_test
blobaa89326a14458876ac0de1a35c9a81b534942fbe
1 [require]
2 GLSL >= 1.10
4 [vertex shader passthrough]
6 [fragment shader]
7 /* SDL2 prior to 12156:e5a666405750 (Aug 28) would render a bunch of
8  * its contents using cos/sin in the VS to handle a user-passed angle
9  * value (See SDL's RenderCopyEx, for example).  If our error at angle
10  * == 0.0 is too much, we'll slightly rotate the images even with
11  * nearest filtering.
12  */
13 uniform float angle;
14 void main()
16         float sin_err = abs(sin(angle) - 0.0);
17         float cos_err = abs(cos(angle) - 1.0);
18         /* Allow a tolerance of half a pixel of error at a 2048x2048
19          * window (viewport is from -1 to 1).
20          */
21         float tolerance = 2.0 / 2048.0 / 2.0;
23         gl_FragColor = vec4(sin_err >= tolerance,
24                             sin_err < tolerance && cos_err < tolerance,
25                             cos_err >= tolerance,
26                             0.0);
29 [test]
30 uniform float angle 0.0
31 draw rect -1 -1 2 2
32 probe all rgba 0.0 1.0 0.0 0.0