aboutsummaryrefslogtreecommitdiff
path: root/tests/spec/arb_gpu_shader_int64/fs-iand-of-iadd-int64.shader_test
blob: ac24421fed30e9421033f4d9fbd4569607ef2c63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
[require]
GLSL >= 4.00
GL_ARB_gpu_shader_int64

[vertex shader passthrough]

[fragment shader]
#extension GL_ARB_gpu_shader_int64: require

out vec4 piglit_fragcolor;

void main()
{
    /* The scale factor and the bias values ensure that every fragment will
     * generate a value larger than (1 << 32).
     */
    uint64_t a = uint64_t(int(gl_FragCoord.x) + 8179) *
		 uint64_t(int(gl_FragCoord.y) + 9931) * 1693ul;

    /* Reassociating the addition and the masking will not have the
     * same result.
     */
    uint64_t b = (a + 0x0ffffffffffffff0ul) & 0x00000000fffffff0ul;

    if (b >= (1ul << 32))
	piglit_fragcolor = vec4(1.0, 0.0, 0.0, 1.0);
    else
	piglit_fragcolor = vec4(0.0, 1.0, 0.0, 1.0);
}

[test]
clear color 0.3 0.3 0.3 0.0
clear

draw rect -1 -1 2 2
probe all rgba 0.0 1.0 0.0 1.0