Android: Handle some possible surface loss cases

This commit is contained in:
Connor McLaughlin
2021-06-07 18:13:05 +10:00
parent 141fac0481
commit 20afc1c4a1
3 changed files with 10 additions and 7 deletions

View File

@ -576,7 +576,7 @@ bool VulkanHostDisplay::DoneRenderContextCurrent()
bool VulkanHostDisplay::Render()
{
if (ShouldSkipDisplayingFrame())
if (ShouldSkipDisplayingFrame() || !m_swap_chain)
{
if (ImGui::GetCurrentContext())
ImGui::Render();
@ -602,6 +602,7 @@ bool VulkanHostDisplay::Render()
{
Log_ErrorPrint("Failed to recreate surface after loss");
g_vulkan_context->ExecuteCommandBuffer(false);
m_swap_chain.reset();
return false;
}