From a053f389bdc31af1d10b1269493d4a6efcd8e83a Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sun, 13 Sep 2020 14:37:00 +1000 Subject: [PATCH] VulkanHostDisplay: Don't choke when we lose the surface --- src/frontend-common/vulkan_host_display.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/frontend-common/vulkan_host_display.cpp b/src/frontend-common/vulkan_host_display.cpp index bcd5bddc1..244b4951b 100644 --- a/src/frontend-common/vulkan_host_display.cpp +++ b/src/frontend-common/vulkan_host_display.cpp @@ -118,7 +118,12 @@ void* VulkanHostDisplay::GetRenderContext() const bool VulkanHostDisplay::ChangeRenderWindow(const WindowInfo& new_wi) { - Assert(!m_swap_chain); + if (new_wi.type == WindowInfo::Type::Surfaceless) + { + g_vulkan_context->ExecuteCommandBuffer(true); + m_swap_chain.reset(); + return true; + } WindowInfo wi_copy(new_wi); VkSurfaceKHR surface = Vulkan::SwapChain::CreateVulkanSurface(g_vulkan_context->GetVulkanInstance(), wi_copy);