mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 07:12:16 +00:00
- slightly adjust AcquireImage to avoid border cases in the spec
This commit is contained in:
parent
a0f618311a
commit
59904faff4
1 changed files with 14 additions and 6 deletions
|
@ -40,15 +40,23 @@ uint32_t VulkanSwapChain::AcquireImage(int width, int height, VulkanSemaphore *s
|
||||||
}
|
}
|
||||||
|
|
||||||
VkResult result = vkAcquireNextImageKHR(device->device, swapChain, 1'000'000'000, 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 || result == VK_TIMEOUT)
|
if (result == VK_SUCCESS)
|
||||||
{
|
|
||||||
Recreate();
|
|
||||||
}
|
|
||||||
else if (result == VK_SUCCESS)
|
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (result == VK_NOT_READY)
|
else if (result == VK_SUBOPTIMAL_KHR)
|
||||||
|
{
|
||||||
|
// Force the recreate to happen next frame.
|
||||||
|
// The spec is not very clear about what happens to the semaphore or the acquired image if the swapchain is recreated before the image is released with a call to vkQueuePresentKHR.
|
||||||
|
lastSwapWidth = 0;
|
||||||
|
lastSwapHeight = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (result == VK_ERROR_OUT_OF_DATE_KHR)
|
||||||
|
{
|
||||||
|
Recreate();
|
||||||
|
}
|
||||||
|
else if (result == VK_NOT_READY || result == VK_TIMEOUT)
|
||||||
{
|
{
|
||||||
imageIndex = 0xffffffff;
|
imageIndex = 0xffffffff;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue