Correctly handle vk::Result::eOutOfDate from vk::raii::SwapchainKHR::acquireNextImage and vk::raii::Queue::presentKHR#248
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
vk::Result::eOutOfDateis an error code forvk::[raii::]SwapchainKRH::acquireNextImageandvk::[raii::]Queue::presentKHR.That is, as long as
VULKAN_HPP_RAII_NO_EXCEPTIONSis not defined, they throw an exception on such a result.In order to catch that error, you have to use the try-catch-idiom.
As usual, if this is considered to be ok, I can carry that change over to the other chapters.
Note 1: I don't know how to enforce a
vk::Result::eOutOfDateerror from any of those two functions. That is, I could not really test the error handling.Note 2: We could as well wait for and require the next VulkanSDK and define
VULKAN_HPP_HANDLE_ERROR_OUT_OF_DATE_AS_SUCCESS, keeping the source as it is (maybe with some additional comments).