Skip to content

Commit

Permalink
GPU/HW: Ensure buffers are freed prior to recreating
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Jul 4, 2024
1 parent 3749b81 commit 4c02507
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/gpu_hw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,11 @@ void GPU_HW::UpdateSettings(const Settings& old_settings)

if (framebuffer_changed)
{
// When using very high upscaling, it's possible that we don't have enough VRAM for two sets of buffers.
// Purge the pool, and idle the GPU so that all video memory is freed prior to creating the new buffers.
g_gpu_device->PurgeTexturePool();
g_gpu_device->ExecuteAndWaitForGPUIdle();

if (!CreateBuffers())
Panic("Failed to recreate buffers.");

Expand Down

0 comments on commit 4c02507

Please sign in to comment.