From 3fd1e6c2f69f83d8c818c5a253a161502868a355 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sat, 15 Apr 2017 20:00:40 +1000 Subject: [PATCH] Vulkan: Ensure all frames are written before resizing framedump buffer Prevents destroying a framebuffer that may still be in use by a previous frame dump. --- Source/Core/VideoBackends/Vulkan/Renderer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Core/VideoBackends/Vulkan/Renderer.cpp b/Source/Core/VideoBackends/Vulkan/Renderer.cpp index 3b446e2292..a683c748fd 100644 --- a/Source/Core/VideoBackends/Vulkan/Renderer.cpp +++ b/Source/Core/VideoBackends/Vulkan/Renderer.cpp @@ -959,6 +959,10 @@ bool Renderer::ResizeFrameDumpBuffer(u32 new_width, u32 new_height) return true; } + // Ensure all previous frames have been dumped, since we are destroying a framebuffer + // that may still be in use. + FlushFrameDump(); + if (m_frame_dump_framebuffer != VK_NULL_HANDLE) { vkDestroyFramebuffer(g_vulkan_context->GetDevice(), m_frame_dump_framebuffer, nullptr);