mirror of https://github.com/snes9xgit/snes9x.git
Vulkan: Catch out-of-date on present that vulkan.hpp throws.
This commit is contained in:
parent
02cb6dc319
commit
67b6d47c09
|
@ -320,11 +320,19 @@ bool Swapchain::swap()
|
|||
.setSwapchains(swapchain_object.get())
|
||||
.setImageIndices(current_swapchain_image);
|
||||
|
||||
auto result = queue.presentKHR(present_info);
|
||||
vk::Result result;
|
||||
try
|
||||
{
|
||||
result = queue.presentKHR(present_info);
|
||||
}
|
||||
catch (std::exception &e)
|
||||
{
|
||||
printf("%s\n", e.what());
|
||||
}
|
||||
|
||||
current_frame = (current_frame + 1) % num_swapchain_images;
|
||||
|
||||
if (result != vk::Result::eSuccess)
|
||||
if (result != vk::Result::eSuccess && result != vk::Result::eSuboptimalKHR)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue