mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-04-26 01:56:34 -05:00
Fixes vulkan renderer closing dolphin when moving between windowed and full screen modes.
This commit is contained in:
parent
de44626d23
commit
798608fd19
|
|
@ -252,6 +252,17 @@ bool SwapChain::SelectPresentMode()
|
||||||
return true;
|
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.
|
// Prefer screen-tearing, if possible, for lowest latency.
|
||||||
if (Common::Contains(present_modes, VK_PRESENT_MODE_IMMEDIATE_KHR))
|
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;
|
m_next_fullscreen_state = false;
|
||||||
|
|
||||||
// Finally re-create the swap chain
|
// Finally re-create the swap chain
|
||||||
|
m_is_recreating_surface = true;
|
||||||
if (!CreateSwapChain() || !SetupSwapChainImages())
|
if (!CreateSwapChain() || !SetupSwapChainImages())
|
||||||
|
{
|
||||||
|
m_is_recreating_surface = false;
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
m_is_recreating_surface = false;
|
||||||
|
RecreateSwapChain();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,8 @@ public:
|
||||||
// Updates the fullscreen state. Must call on-thread.
|
// Updates the fullscreen state. Must call on-thread.
|
||||||
bool SetFullscreenState(bool state);
|
bool SetFullscreenState(bool state);
|
||||||
|
|
||||||
|
bool m_is_recreating_surface = false;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool SelectSurfaceFormat();
|
bool SelectSurfaceFormat();
|
||||||
bool SelectPresentMode();
|
bool SelectPresentMode();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user