Skip to content

Bad handling of VK_ERROR_OUT_OF_DATE_KHR returned from vkAcquireNextImageKHR #30

@michoecho

Description

@michoecho

Currently (permalink), if vkAcquireNextImageKHR returns VK_ERROR_OUT_OF_DATE_KHR, the tutorial code reacts by setting updateSwapchain = true (so that the swapchain is recreated at a later time) and proceeds as usual.

That would be appropriate for VK_SUBOPTIMAL_KHR, but it's not appropriate for VK_ERROR_OUT_OF_DATE_KHR.
VK_ERROR_OUT_OF_DATE_KHR is a failure. The spec says:

If VK_ERROR_OUT_OF_DATE_KHR is returned, no image is acquired

and also

If vkAcquireNextImageKHR does not successfully acquire an image, semaphore and fence are unaffected.

So if vkAcquireNextImageKHR returns VK_ERROR_OUT_OF_DATE_KHR, the main loop is going to break down in some weird way. Presumably it will deadlock, because the presentSemaphores[frameIndex] is never going to be signalled, so the vkQueueSubmit will wait forever on it.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions