WindowInfo: Don't clear display when going surfaceless

Fixes panic when a popup occurs when using GLX.
This commit is contained in:
Connor McLaughlin
2022-11-23 19:13:28 +10:00
parent add2b5fbae
commit 27b0847ee7
6 changed files with 23 additions and 2 deletions

View File

@ -459,6 +459,7 @@ bool D3D11HostDisplay::ChangeRenderWindow(const WindowInfo& new_wi)
void D3D11HostDisplay::DestroyRenderSurface()
{
m_window_info.SetSurfaceless();
if (IsFullscreen())
SetFullscreen(false, 0, 0, 0.0f);

View File

@ -348,6 +348,8 @@ bool D3D12HostDisplay::ChangeRenderWindow(const WindowInfo& new_wi)
void D3D12HostDisplay::DestroyRenderSurface()
{
m_window_info.SetSurfaceless();
// For some reason if we don't execute the command list here, the swap chain is in use.. not sure where.
g_d3d12_context->ExecuteCommandList(true);

View File

@ -408,7 +408,7 @@ void OpenGLHostDisplay::DestroyRenderSurface()
if (!m_gl_context)
return;
m_window_info = {};
m_window_info.SetSurfaceless();
if (!m_gl_context->ChangeSurface(m_window_info))
Log_ErrorPrintf("Failed to switch to surfaceless");
}

View File

@ -130,7 +130,7 @@ HostDisplay::AdapterAndModeList VulkanHostDisplay::GetAdapterAndModeList()
void VulkanHostDisplay::DestroyRenderSurface()
{
m_window_info = {};
m_window_info.SetSurfaceless();
g_vulkan_context->WaitForGPUIdle();
m_swap_chain.reset();
}