Skip to content

Commit 3b797ab

Browse files
committed
Prevent artifacts in Global Surface Atlas when close to its capacity
1 parent b6aa385 commit 3b797ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Source/Engine/Renderer/GI/GlobalSurfaceAtlasPass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ bool GlobalSurfaceAtlasPass::Render(RenderContext& renderContext, GPUContext* co
718718
}
719719

720720
// Allocate buffer for culled objects (estimated size)
721-
objectsBufferCapacity = Math::Min(Math::AlignUp<uint32>(objectsBufferCapacity * sizeof(uint32), 4096u), (uint32)MAX_int32);
721+
objectsBufferCapacity = Math::Min(Math::AlignUp<uint32>(objectsBufferCapacity * sizeof(uint32) * 2, 4096u), (uint32)MAX_int32);
722722
if (!surfaceAtlasData.CulledObjectsBuffer)
723723
surfaceAtlasData.CulledObjectsBuffer = GPUDevice::Instance->CreateBuffer(TEXT("GlobalSurfaceAtlas.CulledObjectsBuffer"));
724724
if (surfaceAtlasData.CulledObjectsBuffer->GetSize() < objectsBufferCapacity)

0 commit comments

Comments
 (0)