i did a little memory optimisation (19GB of VRAM -> 2.6GB of VRAM), lost some FPS in vertex rendering as a result but i'll figure it out
This commit is contained in:
parent
bf9af81f38
commit
ce7051d8ca
21 changed files with 766 additions and 592 deletions
|
|
@ -2,13 +2,10 @@
|
|||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
const uint FLOATS_PER_VERTEX = 14u;
|
||||
|
||||
struct DrawCommand {
|
||||
uint indexCount;
|
||||
uint vertexCount;
|
||||
uint instanceCount;
|
||||
uint firstIndex;
|
||||
int vertexOffset;
|
||||
uint firstVertex;
|
||||
uint firstInstance;
|
||||
};
|
||||
|
||||
|
|
@ -17,26 +14,23 @@ layout(std430, binding = 0) buffer DrawCommands {
|
|||
};
|
||||
|
||||
layout(std430, binding = 1) buffer Counters {
|
||||
uint vertexCount;
|
||||
uint indexCount;
|
||||
uint faceCount;
|
||||
} counters;
|
||||
|
||||
layout(push_constant) uniform ChunkInfo {
|
||||
ivec3 chunkPos;
|
||||
int slot;
|
||||
uint vertexFloatOffset;
|
||||
uint indexOffset;
|
||||
uint faceOffset;
|
||||
uint unused0;
|
||||
uint indirectCommandIndex;
|
||||
uint padding0;
|
||||
};
|
||||
|
||||
void main() {
|
||||
drawCmds[indirectCommandIndex].indexCount = 0u;
|
||||
drawCmds[indirectCommandIndex].vertexCount = 0u;
|
||||
drawCmds[indirectCommandIndex].instanceCount = 1u;
|
||||
drawCmds[indirectCommandIndex].firstIndex = indexOffset;
|
||||
drawCmds[indirectCommandIndex].vertexOffset = int(vertexFloatOffset / FLOATS_PER_VERTEX);
|
||||
drawCmds[indirectCommandIndex].firstVertex = faceOffset * 6u;
|
||||
drawCmds[indirectCommandIndex].firstInstance = 0u;
|
||||
|
||||
counters.vertexCount = 0u;
|
||||
counters.indexCount = 0u;
|
||||
counters.faceCount = 0u;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue