1 # Verify simple reading of a uniform and output to an atomic counter
7 GL_ARB_shader_atomic_counters
11 #extension GL_ARB_compute_shader: enable
12 #extension GL_ARB_shader_atomic_counters: require
14 layout(binding = 0) uniform atomic_uint atomic1;
15 layout(binding = 0) uniform atomic_uint atomic2;
17 uniform uint atomic_num;
19 layout(local_size_x = 16, local_size_y = 16) in;
23 if (atomic_num == 1u) {
24 atomicCounterIncrement(atomic1);
25 } else if (atomic_num == 2u) {
26 atomicCounterIncrement(atomic2);
33 uniform uint atomic_num 0
35 probe atomic counter 0 == 0
36 probe atomic counter 1 == 0
38 uniform uint atomic_num 1
40 probe atomic counter 0 == 256
41 probe atomic counter 1 == 0
43 uniform uint atomic_num 2
45 probe atomic counter 0 == 256
46 probe atomic counter 1 == 512
48 uniform uint atomic_num 3
50 probe atomic counter 0 == 256
51 probe atomic counter 1 == 512
53 uniform uint atomic_num 1
55 probe atomic counter 0 == 512
56 probe atomic counter 1 == 512