perf/pixel-rate: new pixel throughput microbenchmark
[piglit.git] / tests / spec / glsl-1.30 / execution / fs-uint-to-float-of-extract-int8.shader_test
blob8d11a347868c0e06dcdedab110282eb22be13352
1 # Intel compiler has a very old optimization for various combination
2 # of u2f or i2f of an extract_* source. However, the variations that
3 # do u2f of an extract_i* are incorrect.
5 # There are two ways the fast path could be incorrect. It could either
6 # emit
8 #    mov(8)   g1F, g2<4,1,0>B
10 # or it could emit
12 #    mov(8)   g1F, g2<4,1,0>UB
14 # The former produce -1.0 and the latter would produce 255.0. The
15 # current incorrect implementation just happens to be the former, but
16 # the latter has equal probability of being implemented. I implemented
17 # the test so either of the possible incorrect fast path
18 # implementations would render blue, but any other kind of bug would
19 # render red.
21 [require]
22 GLSL >= 1.30
24 [vertex shader passthrough]
26 [fragment shader]
27 #version 130
29 uniform int a = 0x000000ff;
31 void main()
33    float f = float(uint((a << 24) >> 24));
35    if (f == float(uint(0xffffffff))) {
36       gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
37    } else {
38      gl_FragColor = (f == 255.0 || f == -1.0)
39          ? vec4(0.0, 0.0, 1.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
40    }
43 [test]
44 draw rect -1 -1 2 2
45 probe all rgba 0.0 1.0 0.0 1.0