Fixes vulkan renderer closing dolphin when moving between windowed and full screen modes.

This commit is contained in:
Linkinworm 2026-03-19 11:12:53 +00:00
parent de44626d23
commit 798608fd19
2 changed files with 19 additions and 1 deletions

View File

@ -252,6 +252,17 @@ bool SwapChain::SelectPresentMode()
return true;
}
#if defined(VK_USE_PLATFORM_ANDROID_KHR)
if (m_is_recreating_surface)
{
if (Common::Contains(present_modes, VK_PRESENT_MODE_FIFO_RELAXED_KHR))
m_present_mode = VK_PRESENT_MODE_FIFO_RELAXED_KHR;
else
m_present_mode = VK_PRESENT_MODE_FIFO_KHR;
return true;
}
#endif
// Prefer screen-tearing, if possible, for lowest latency.
if (Common::Contains(present_modes, VK_PRESENT_MODE_IMMEDIATE_KHR))
{
@ -604,9 +615,14 @@ bool SwapChain::RecreateSurface(void* native_handle)
m_next_fullscreen_state = false;
// Finally re-create the swap chain
m_is_recreating_surface = true;
if (!CreateSwapChain() || !SetupSwapChainImages())
{
m_is_recreating_surface = false;
return false;
}
m_is_recreating_surface = false;
RecreateSwapChain();
return true;
}

View File

@ -72,6 +72,8 @@ public:
// Updates the fullscreen state. Must call on-thread.
bool SetFullscreenState(bool state);
bool m_is_recreating_surface = false;
private:
bool SelectSurfaceFormat();
bool SelectPresentMode();