Check swapchain acquire result and rebuild if necessary, error handling (refs #320)
This commit is contained in:
parent
2d3f1dba09
commit
1912101fe8
2 changed files with 23 additions and 24 deletions
|
|
@ -552,8 +552,15 @@ void VulkanExampleBase::getOverlayText(VulkanTextOverlay *textOverlay)
|
|||
|
||||
void VulkanExampleBase::prepareFrame()
|
||||
{
|
||||
// Acquire the next image from the swap chaing
|
||||
VK_CHECK_RESULT(swapChain.acquireNextImage(semaphores.presentComplete, ¤tBuffer));
|
||||
// Acquire the next image from the swap chain
|
||||
VkResult err = swapChain.acquireNextImage(semaphores.presentComplete, ¤tBuffer);
|
||||
// Recreate the swapchain if it's no longer compatible with the surface (OUT_OF_DATE) or no longer optimal for presentation (SUBOPTIMAL)
|
||||
if ((err == VK_ERROR_OUT_OF_DATE_KHR) || (err == VK_SUBOPTIMAL_KHR)) {
|
||||
windowResize();
|
||||
}
|
||||
else {
|
||||
VK_CHECK_RESULT(err);
|
||||
}
|
||||
}
|
||||
|
||||
void VulkanExampleBase::submitFrame()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue