diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.cpp b/rpcs3/Emu/RSX/VK/VKGSRender.cpp index 84fc6f6372..16509a9d78 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.cpp +++ b/rpcs3/Emu/RSX/VK/VKGSRender.cpp @@ -2230,6 +2230,7 @@ void VKGSRender::present(frame_context_t *ctx) case VK_SUCCESS: break; case VK_SUBOPTIMAL_KHR: + should_reinitialize_swapchain = true; break; case VK_ERROR_OUT_OF_DATE_KHR: swapchain_unavailable = true; @@ -3110,6 +3111,7 @@ void VKGSRender::reinitialize_swapchain() open_command_buffer(); swapchain_unavailable = false; + should_reinitialize_swapchain = false; } void VKGSRender::flip(int buffer, bool emu_flip) @@ -3124,7 +3126,7 @@ void VKGSRender::flip(int buffer, bool emu_flip) } } - if (swapchain_unavailable) + if (swapchain_unavailable || should_reinitialize_swapchain) { reinitialize_swapchain(); } @@ -3249,6 +3251,9 @@ void VKGSRender::flip(int buffer, bool emu_flip) check_present_status(); continue; } + case VK_SUBOPTIMAL_KHR: + should_reinitialize_swapchain = true; + break; case VK_ERROR_OUT_OF_DATE_KHR: LOG_WARNING(RSX, "vkAcquireNextImageKHR failed with VK_ERROR_OUT_OF_DATE_KHR. Flip request ignored until surface is recreated."); swapchain_unavailable = true; diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.h b/rpcs3/Emu/RSX/VK/VKGSRender.h index 4d65be19c7..328c1ff27f 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.h +++ b/rpcs3/Emu/RSX/VK/VKGSRender.h @@ -359,6 +359,7 @@ private: sizeu m_swapchain_dims{}; bool swapchain_unavailable = false; + bool should_reinitialize_swapchain = false; u64 m_last_heap_sync_time = 0; u32 m_texbuffer_view_size = 0;