From 7ea425ee25f1538470373869c1312f8c204ca736 Mon Sep 17 00:00:00 2001 From: Yamagi Date: Sat, 24 Apr 2021 19:29:10 +0200 Subject: [PATCH] Handle VK_TIMEOUT, may lead to restart loops. --- src/client/refresh/vk/vk_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/refresh/vk/vk_common.c b/src/client/refresh/vk/vk_common.c index 5bbf8d2c..17f033f0 100644 --- a/src/client/refresh/vk/vk_common.c +++ b/src/client/refresh/vk/vk_common.c @@ -2072,7 +2072,7 @@ VkResult QVk_BeginFrame(const VkViewport* viewport, const VkRect2D* scissor) ReleaseSwapBuffers(); VkResult result = vkAcquireNextImageKHR(vk_device.logical, vk_swapchain.sc, UINT32_MAX, vk_imageAvailableSemaphores[vk_activeBufferIdx], VK_NULL_HANDLE, &vk_imageIndex); - if (result == VK_ERROR_OUT_OF_DATE_KHR || result == VK_SUBOPTIMAL_KHR || result == VK_ERROR_SURFACE_LOST_KHR) + if (result == VK_ERROR_OUT_OF_DATE_KHR || result == VK_SUBOPTIMAL_KHR || result == VK_ERROR_SURFACE_LOST_KHR || result == VK_TIMEOUT) { // for VK_OUT_OF_DATE_KHR and VK_SUBOPTIMAL_KHR it'd be fine to just rebuild the swapchain but let's take the easy way out and restart Vulkan. R_Printf(PRINT_ALL, "%s(): received %s after vkAcquireNextImageKHR - restarting video!\n", __func__, QVk_GetError(result));