From 580839ff032f40434864e3ecdc95ee9b66fd0c0e Mon Sep 17 00:00:00 2001 From: "r.kuznetsov" Date: Thu, 13 Jun 2019 14:52:16 +0300 Subject: [PATCH] [vulkan] Fixed crash after getting foreground --- drape/vulkan/vulkan_base_context.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drape/vulkan/vulkan_base_context.cpp b/drape/vulkan/vulkan_base_context.cpp index bd78b3a615..e0490ab7a4 100644 --- a/drape/vulkan/vulkan_base_context.cpp +++ b/drape/vulkan/vulkan_base_context.cpp @@ -213,7 +213,9 @@ bool VulkanBaseContext::BeginRendering() res = vkAcquireNextImageKHR(m_device, m_swapchain, std::numeric_limits::max() /* kTimeoutNanoseconds */, m_acquireSemaphores[m_inflightFrameIndex], VK_NULL_HANDLE, &m_imageIndex); - if (res == VK_TIMEOUT) + // VK_ERROR_SURFACE_LOST_KHR appears sometimes after getting foreground. We suppose rendering can be recovered + // next frame. + if (res == VK_TIMEOUT || res == VK_ERROR_SURFACE_LOST_KHR) { vkDeviceWaitIdle(m_device); DestroySyncPrimitives();