36 lines
No EOL
801 B
GLSL
36 lines
No EOL
801 B
GLSL
#version 460
|
|
|
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
|
|
|
struct DrawCommand {
|
|
uint vertexCount;
|
|
uint instanceCount;
|
|
uint firstVertex;
|
|
uint firstInstance;
|
|
};
|
|
|
|
layout(std430, binding = 0) buffer DrawCommands {
|
|
DrawCommand drawCmds[];
|
|
};
|
|
|
|
layout(std430, binding = 1) buffer Counters {
|
|
uint faceCount;
|
|
} counters;
|
|
|
|
layout(push_constant) uniform ChunkInfo {
|
|
ivec3 chunkPos;
|
|
int slot;
|
|
uint faceOffset;
|
|
uint unused0;
|
|
uint indirectCommandIndex;
|
|
uint padding0;
|
|
};
|
|
|
|
void main() {
|
|
drawCmds[indirectCommandIndex].vertexCount = 0u;
|
|
drawCmds[indirectCommandIndex].instanceCount = 1u;
|
|
drawCmds[indirectCommandIndex].firstVertex = faceOffset * 6u;
|
|
drawCmds[indirectCommandIndex].firstInstance = 0u;
|
|
|
|
counters.faceCount = 0u;
|
|
} |