Fix threading issues with GPU buffers mapping

This commit is contained in:
Wojciech Figat
2023-01-04 12:06:56 +01:00
committed by Wojtek Figat
parent e2aa6b8970
commit 0595f38fe4
6 changed files with 15 additions and 6 deletions

View File

@@ -684,13 +684,13 @@ bool GlobalSurfaceAtlasPass::Render(RenderContext& renderContext, GPUContext* co
if (data)
{
uint32 counter = data[surfaceAtlasData.CulledObjectsCounterIndex];
_culledObjectsSizeBuffer->Unmap();
if (counter > 0)
{
objectsBufferCapacity = counter;
notReady = false;
}
}
_culledObjectsSizeBuffer->Unmap();
// Allow to be ready if the buffer was already used
if (notReady && surfaceAtlasData.CulledObjectsBuffer && surfaceAtlasData.CulledObjectsBuffer->IsAllocated())