Be robust to queuePresent returning VK_SUBOPTIMAL_KHR
This commit is contained in:
parent
f544895708
commit
05bf2105f4
1 changed files with 5 additions and 1 deletions
|
|
@ -355,7 +355,11 @@ public:
|
||||||
// Present the current buffer to the swap chain
|
// Present the current buffer to the swap chain
|
||||||
// Pass the semaphore signaled by the command buffer submission from the submit info as the wait semaphore for swap chain presentation
|
// Pass the semaphore signaled by the command buffer submission from the submit info as the wait semaphore for swap chain presentation
|
||||||
// This ensures that the image is not presented to the windowing system until all commands have been submitted
|
// This ensures that the image is not presented to the windowing system until all commands have been submitted
|
||||||
VK_CHECK_RESULT(swapChain.queuePresent(queue, currentBuffer, renderCompleteSemaphore));
|
VkResult present = swapChain.queuePresent(queue, currentBuffer, renderCompleteSemaphore);
|
||||||
|
if (!((present == VK_SUCCESS) || (present == VK_SUBOPTIMAL_KHR))) {
|
||||||
|
VK_CHECK_RESULT(present);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prepare vertex and index buffers for an indexed triangle
|
// Prepare vertex and index buffers for an indexed triangle
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue