vk: Drain the pending frame queue before resizing the swapchain

This commit is contained in:
kd-11
2026-01-26 00:23:48 +03:00
committed by Ani
parent fb420d5989
commit 0ee3e24b25

View File

@@ -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();