Vulkan: Catch out-of-date exception on swapchain acquire.

This commit is contained in:
BearOso 2023-09-04 18:57:35 -05:00
parent 67b6d47c09
commit f7ddc412f9

View File

@ -267,7 +267,16 @@ bool Swapchain::begin_frame()
return false;
}
auto result_value = device.acquireNextImageKHR(swapchain_object.get(), 33333333, frame.acquire.get());
vk::ResultValue<uint32_t> result_value(vk::Result::eSuccess, 0);
try
{
result_value = device.acquireNextImageKHR(swapchain_object.get(), 33333333, frame.acquire.get());
}
catch (vk::OutOfDateKHRError)
{
result_value.result = vk::Result::eErrorOutOfDateKHR;
}
if (result_value.result == vk::Result::eErrorOutOfDateKHR ||
result_value.result == vk::Result::eSuboptimalKHR)
{