From 3b797ab1dc607b7208b790ba37840cdb00546df4 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Sun, 19 Feb 2023 17:36:44 +0100 Subject: [PATCH] Prevent artifacts in Global Surface Atlas when close to its capacity --- Source/Engine/Renderer/GI/GlobalSurfaceAtlasPass.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Engine/Renderer/GI/GlobalSurfaceAtlasPass.cpp b/Source/Engine/Renderer/GI/GlobalSurfaceAtlasPass.cpp index 860c1b285..c19030bd6 100644 --- a/Source/Engine/Renderer/GI/GlobalSurfaceAtlasPass.cpp +++ b/Source/Engine/Renderer/GI/GlobalSurfaceAtlasPass.cpp @@ -718,7 +718,7 @@ bool GlobalSurfaceAtlasPass::Render(RenderContext& renderContext, GPUContext* co } // Allocate buffer for culled objects (estimated size) - objectsBufferCapacity = Math::Min(Math::AlignUp(objectsBufferCapacity * sizeof(uint32), 4096u), (uint32)MAX_int32); + objectsBufferCapacity = Math::Min(Math::AlignUp(objectsBufferCapacity * sizeof(uint32) * 2, 4096u), (uint32)MAX_int32); if (!surfaceAtlasData.CulledObjectsBuffer) surfaceAtlasData.CulledObjectsBuffer = GPUDevice::Instance->CreateBuffer(TEXT("GlobalSurfaceAtlas.CulledObjectsBuffer")); if (surfaceAtlasData.CulledObjectsBuffer->GetSize() < objectsBufferCapacity)