1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#ifdef GPUINDEXING layout(binding=0, std430) buffer offsetBuffer { uint count[]; }; #else layout(binding=2, std430) buffer countBuffer { uint count[]; }; #endif uniform uint width; void main() { atomicAdd(count[uint(gl_FragCoord.y)*width+uint(gl_FragCoord.x)],1u); discard; }