Revision control
Copy as Markdown
#version 430
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
struct IndexedIndirectDrawCommand
{
uint indexCount;
uint instanceCount;
uint firstIndex;
int vertexOffset;
uint firstInstance;
};
layout(std430, binding = 0) buffer IndirectDrawBuffer
{
IndexedIndirectDrawCommand commands[];
};
void main()
{
uint i = gl_GlobalInvocationID.x;
if (i == 0u) {
commands[0].indexCount = 6u;
commands[0].instanceCount = 1u;
commands[0].firstIndex = 0u;
commands[0].vertexOffset = 0;
commands[0].firstInstance = 0u;
} else if (i == 1u) {
commands[1].indexCount = 6u;
commands[1].instanceCount = 1u;
commands[1].firstIndex = 0u;
commands[1].vertexOffset = 4;
commands[1].firstInstance = 0u;
}
}