Fix single-frame DDGI black artifacts when Global Surface Atlas got defragmented

This commit is contained in:
Wojtek Figat
2024-06-18 14:17:50 +02:00
parent 2c4de9878e
commit 7f2464684a

View File

@@ -719,6 +719,8 @@ bool GlobalSurfaceAtlasPass::Render(RenderContext& renderContext, GPUContext* co
objectsBufferCapacity = surfaceAtlasData.CulledObjectsUsageHistory.Maximum(); // Use biggest value from history
if (surfaceAtlasData.CulledObjectsUsageHistory.Count() == surfaceAtlasData.CulledObjectsUsageHistory.Capacity())
notReady = false; // Always ready when rendering for some time
else if (currentFrame != 0 && surfaceAtlasData.LastFrameAtlasDefragmentation == currentFrame)
notReady = false; // Always ready when did atlas defragmentation during this frame (prevent 1 black frame)
// Allocate buffer for culled objects (estimated size)
if (!surfaceAtlasData.CulledObjectsBuffer)