Fill stats and draw count buffer with zeroes

Fixes #748
This commit is contained in:
Sascha Willems 2022-12-31 16:01:11 +01:00
parent e0a49c20e8
commit 6e68f76456
3 changed files with 19 additions and 12 deletions

View file

@ -78,16 +78,6 @@ void main()
{
uint idx = gl_GlobalInvocationID.x + gl_GlobalInvocationID.y * gl_NumWorkGroups.x * gl_WorkGroupSize.x;
// Clear stats on first invocation
if (idx == 0)
{
atomicExchange(uboOut.drawCount, 0);
for (uint i = 0; i < MAX_LOD_LEVEL + 1; i++)
{
atomicExchange(uboOut.lodCount[i], 0);
}
}
vec4 pos = vec4(instances[idx].pos.xyz, 1.0);
// Check if object is within current viewing frustum