- workaround for drivers that bug by never acquiring an image

This commit is contained in:
Magnus Norddahl 2019-04-08 21:01:40 +02:00
parent c98dfd1790
commit 2694b0a167

View file

@ -54,8 +54,8 @@ uint32_t VulkanSwapChain::AcquireImage(int width, int height, VulkanSemaphore *s
break; break;
} }
VkResult result = vkAcquireNextImageKHR(device->device, swapChain, std::numeric_limits<uint64_t>::max(), semaphore ? semaphore->semaphore : VK_NULL_HANDLE, fence ? fence->fence : VK_NULL_HANDLE, &imageIndex); VkResult result = vkAcquireNextImageKHR(device->device, swapChain, 1'000'000'000, semaphore ? semaphore->semaphore : VK_NULL_HANDLE, fence ? fence->fence : VK_NULL_HANDLE, &imageIndex);
if (result == VK_ERROR_OUT_OF_DATE_KHR || result == VK_SUBOPTIMAL_KHR) if (result == VK_ERROR_OUT_OF_DATE_KHR || result == VK_SUBOPTIMAL_KHR || result == VK_TIMEOUT)
{ {
Recreate(); Recreate();
} }
@ -63,7 +63,7 @@ uint32_t VulkanSwapChain::AcquireImage(int width, int height, VulkanSemaphore *s
{ {
break; break;
} }
else if (result == VK_TIMEOUT || result == VK_NOT_READY) else if (result == VK_NOT_READY)
{ {
imageIndex = 0xffffffff; imageIndex = 0xffffffff;
break; break;