From 0ee3e24b25a119ac8810c30a5065ab846419214b Mon Sep 17 00:00:00 2001 From: kd-11 Date: Mon, 26 Jan 2026 00:23:48 +0300 Subject: [PATCH] vk: Drain the pending frame queue before resizing the swapchain --- rpcs3/Emu/RSX/VK/VKPresent.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/rpcs3/Emu/RSX/VK/VKPresent.cpp b/rpcs3/Emu/RSX/VK/VKPresent.cpp index 4f4517d062..f9fbb114ed 100644 --- a/rpcs3/Emu/RSX/VK/VKPresent.cpp +++ b/rpcs3/Emu/RSX/VK/VKPresent.cpp @@ -61,6 +61,21 @@ void VKGSRender::reinitialize_swapchain() frame_context_cleanup(&ctx); } + // NOTE: frame_context_cleanup alters the queued_frames structure. + while (!m_queued_frames.empty()) + { + auto& frame = m_queued_frames.front(); + if (!frame->swap_command_buffer) + { + // Drop it + m_queued_frames.pop_front(); + continue; + } + + frame_context_cleanup(frame); + } + ensure(m_queued_frames.empty()); + // Discard the current upscaling pipeline if any m_upscaler.reset();