#version 450
#extension GL_ARB_separate_shader_objects : enable
#extension GL_EXT_shader_explicit_arithmetic_types_int8    : enable
#extension GL_EXT_shader_explicit_arithmetic_types_int32   : enable

#define MAX_BUFFERS 5

layout(binding = 0) buffer Params
{
  uint32_t numBuffers;
  uint32_t bufferSize;
  uint32_t interBufferOffset;
};
layout(binding = 1) buffer Buffer
{
  uint8_t ptr[];
} bufferPtrList[MAX_BUFFERS];
layout(local_size_x = 512) in;
void main() {
    for (uint32_t bufIdx = 0; bufIdx < numBuffers; bufIdx++) {
        uint32_t ptrIdx = gl_GlobalInvocationID.x;
        uint32_t limit = bufferSize;
        while (ptrIdx < limit) {
            bufferPtrList[bufIdx].ptr[ptrIdx]++;
            ptrIdx += (gl_NumWorkGroups.x * gl_WorkGroupSize.x);
        }
    }
}