Skip to content

Commit

Permalink
set meshlet-visibility bits atomically
Browse files Browse the repository at this point in the history
  • Loading branch information
crocdialer committed Oct 20, 2024
1 parent fe9b01a commit a7c089d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions shaders/pbr/cull_meshlets.task
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ void set_visible(uint visibility_base_index, uint meshlet_index, bool visible)
{
if(visible)
{
meshlet_visibilities[visibility_base_index + meshlet_index >> 5] |= (1 << (meshlet_index & 31U));
atomicOr(meshlet_visibilities[visibility_base_index + meshlet_index >> 5], 1 << (meshlet_index & 31U));
}
else
{
meshlet_visibilities[visibility_base_index + meshlet_index >> 5] &= ~(1 << (meshlet_index & 31U));
atomicAnd(meshlet_visibilities[visibility_base_index + meshlet_index >> 5], ~(1 << (meshlet_index & 31U)));
}
}

Expand Down Expand Up @@ -158,4 +158,4 @@ void main()
uint count = gl_WorkGroupSize.x;
EmitMeshTasksEXT(count, 1, 1);
#endif
}
}

0 comments on commit a7c089d

Please sign in to comment.