mirror of https://github.com/PCSX2/pcsx2.git
GS: Fix hang when switching renderer while fullscreen
This commit is contained in:
parent
d8239664a8
commit
0c389789f3
|
@ -359,6 +359,7 @@ void GSclose()
|
|||
{
|
||||
CloseGSRenderer();
|
||||
CloseGSDevice(true);
|
||||
Host::ReleaseRenderWindow();
|
||||
}
|
||||
|
||||
void GSreset(bool hardware_reset)
|
||||
|
|
|
@ -216,12 +216,6 @@ bool GSDevice::AcquireWindow(bool recreate_window)
|
|||
return true;
|
||||
}
|
||||
|
||||
void GSDevice::ReleaseWindow()
|
||||
{
|
||||
Host::ReleaseRenderWindow();
|
||||
m_window_info = WindowInfo();
|
||||
}
|
||||
|
||||
bool GSDevice::GetHostRefreshRate(float* refresh_rate)
|
||||
{
|
||||
if (m_window_info.surface_refresh_rate > 0.0f)
|
||||
|
|
|
@ -780,7 +780,6 @@ protected:
|
|||
FeatureSupport m_features;
|
||||
|
||||
bool AcquireWindow(bool recreate_window);
|
||||
void ReleaseWindow();
|
||||
|
||||
virtual GSTexture* CreateSurface(GSTexture::Type type, int width, int height, int levels, GSTexture::Format format) = 0;
|
||||
GSTexture* FetchSurface(GSTexture::Type type, int width, int height, int levels, GSTexture::Format format, bool clear, bool prefer_reuse);
|
||||
|
|
|
@ -493,7 +493,6 @@ void GSDevice11::Destroy()
|
|||
{
|
||||
GSDevice::Destroy();
|
||||
DestroySwapChain();
|
||||
ReleaseWindow();
|
||||
DestroyTimestampQueries();
|
||||
|
||||
m_convert = {};
|
||||
|
@ -769,7 +768,6 @@ bool GSDevice11::UpdateWindow()
|
|||
if (m_window_info.type != WindowInfo::Type::Surfaceless && !CreateSwapChain())
|
||||
{
|
||||
Console.WriteLn("Failed to create swap chain on updated window");
|
||||
ReleaseWindow();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -218,7 +218,6 @@ void GSDevice12::Destroy()
|
|||
ExecuteCommandList(true);
|
||||
DestroyResources();
|
||||
DestroySwapChain();
|
||||
ReleaseWindow();
|
||||
g_d3d12_context->Destroy();
|
||||
}
|
||||
}
|
||||
|
@ -432,7 +431,6 @@ bool GSDevice12::UpdateWindow()
|
|||
if (m_window_info.type != WindowInfo::Type::Surfaceless && !CreateSwapChain())
|
||||
{
|
||||
Console.WriteLn("Failed to create swap chain on updated window");
|
||||
ReleaseWindow();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -1170,7 +1170,6 @@ void GSDeviceMTL::Destroy()
|
|||
|
||||
GSDevice::Destroy();
|
||||
GSDeviceMTL::DestroySurface();
|
||||
ReleaseWindow();
|
||||
m_queue = nullptr;
|
||||
m_dev.Reset();
|
||||
}}
|
||||
|
|
|
@ -551,8 +551,6 @@ void GSDeviceOGL::Destroy()
|
|||
|
||||
m_gl_context->DoneCurrent();
|
||||
m_gl_context.reset();
|
||||
|
||||
ReleaseWindow();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -673,7 +671,6 @@ bool GSDeviceOGL::UpdateWindow()
|
|||
if (!m_gl_context->ChangeSurface(m_window_info))
|
||||
{
|
||||
Console.Error("Failed to change surface");
|
||||
ReleaseWindow();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -257,7 +257,6 @@ void GSDeviceVK::Destroy()
|
|||
|
||||
g_vulkan_context->WaitForGPUIdle();
|
||||
m_swap_chain.reset();
|
||||
ReleaseWindow();
|
||||
|
||||
Vulkan::ShaderCache::Destroy();
|
||||
Vulkan::Context::Destroy();
|
||||
|
@ -295,7 +294,6 @@ bool GSDeviceVK::UpdateWindow()
|
|||
if (surface == VK_NULL_HANDLE)
|
||||
{
|
||||
Console.Error("Failed to create new surface for swap chain");
|
||||
ReleaseWindow();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -304,7 +302,6 @@ bool GSDeviceVK::UpdateWindow()
|
|||
{
|
||||
Console.Error("Failed to create swap chain");
|
||||
Vulkan::SwapChain::DestroyVulkanSurface(g_vulkan_context->GetVulkanInstance(), &m_window_info, surface);
|
||||
ReleaseWindow();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -572,8 +569,6 @@ bool GSDeviceVK::CreateDeviceAndSwapChain()
|
|||
if (!AcquireWindow(true))
|
||||
return false;
|
||||
|
||||
ScopedGuard window_cleanup = [this]() { ReleaseWindow(); };
|
||||
|
||||
VkInstance instance =
|
||||
Vulkan::Context::CreateVulkanInstance(m_window_info, enable_debug_utils, enable_validation_layer);
|
||||
if (instance == VK_NULL_HANDLE)
|
||||
|
@ -668,7 +663,6 @@ bool GSDeviceVK::CreateDeviceAndSwapChain()
|
|||
|
||||
surface_cleanup.Cancel();
|
||||
instance_cleanup.Cancel();
|
||||
window_cleanup.Cancel();
|
||||
library_cleanup.Cancel();
|
||||
|
||||
// Render a frame as soon as possible to clear out whatever was previously being displayed.
|
||||
|
|
Loading…
Reference in New Issue