1#version 310 es
2
3layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
4layout(binding = 0) buffer InOut {
5    uint values[1024];
6} sb_inout;
7
8void main (void) {
9    uvec3 size           = gl_NumWorkGroups * gl_WorkGroupSize;
10    uint numValuesPerInv = uint(sb_inout.values.length()) / (size.x*size.y*size.z);
11    uint groupNdx        = size.x*size.y*gl_GlobalInvocationID.z + size.x*gl_GlobalInvocationID.y + gl_GlobalInvocationID.x;
12    uint offset          = numValuesPerInv*groupNdx;
13
14    for (uint ndx = 0u; ndx < numValuesPerInv; ndx++)
15        sb_inout.values[offset + ndx] = ~sb_inout.values[offset + ndx];
16}
17