Fix render target pool over-allocation when changing render resolution frequently

#2077
This commit is contained in:
Wojtek Figat
2023-12-16 16:15:52 +01:00
parent 074ad171ba
commit 2bef880e21
3 changed files with 33 additions and 40 deletions

View File

@@ -192,6 +192,9 @@ bool RenderBuffers::Init(int32 width, int32 height)
_viewport = Viewport(0, 0, static_cast<float>(width), static_cast<float>(height));
LastEyeAdaptationTime = 0;
// Flush any pool render targets to prevent over-allocating GPU memory when resizing game viewport
RenderTargetPool::Flush(false, 4);
return result;
}