4 GL_ARB_shader_storage_buffer_object
5 GL_ARB_shader_atomic_counters
6 GL_ARB_shader_atomic_counter_ops
8 [vertex shader passthrough]
11 #extension GL_ARB_shader_storage_buffer_object: require
12 #extension GL_ARB_shader_atomic_counters: require
13 #extension GL_ARB_shader_atomic_counter_ops: require
15 layout(binding = 0) buffer bufblock {
19 /* GL_ARB_shader_atomic_counters requires at least 8 total counters. */
20 layout(binding = 0) uniform atomic_uint mask[7];
21 layout(binding = 0) uniform atomic_uint fail;
27 /* Each of 32 * N fragments should see a unique value. Each value
28 * observed is tracked in "mask." The test automatically fails if a
29 * duplicate value is observed. After the shaders are done running,
30 * the mask values will be probed to ensure that all possible values
33 int f = atomicAdd(value, 4);
34 uint i = uint(f) / 4u;
39 if (c < mask.length()) {
40 /* If the bit was already set, the test fails. */
41 if ((atomicCounterOrARB(mask[c], m) & m) != 0u)
42 atomicCounterIncrement(fail);
44 color = vec4(0.0, 1.0, 0.0, 1.0);
46 color = vec4(0.0, 0.0, 1.0, 1.0);
54 ssbo 0 subdata float 0 0.0
56 clear color 0.5 0.5 0.5 0.5
61 probe atomic counter 0 == 4294967295
62 probe atomic counter 1 == 4294967295
63 probe atomic counter 2 == 4294967295
64 probe atomic counter 3 == 4294967295
65 probe atomic counter 4 == 4294967295
66 probe atomic counter 5 == 4294967295
67 probe atomic counter 6 == 4294967295
68 probe atomic counter 7 == 0