I 'm using InterlockedOr to perform scene voxelization.
This buffer never needs to leave the GPU.
I’ve tried a couple approaches:
A 1D compute shader that just sets all values to zero. This takes a ms or two - I think I can schedule this at the AFTER rendering completes, though, and it shouldn’t have a large impact.
_MyBuffer[id] = 0;
Setting empty data every frame - this gets costly
buffer.SetData(emptyData);
Is there something else I should consider? Something clever? Or something obvious? The GL.Clear() equivalent for a buffer?
Maybe I should just clear them in the compute shader after I’ve used them?