mirror of https://github.com/AxioDL/boo.git
Vulkan: Handle out-of-date swapchain during resize
This commit is contained in:
parent
0445e5d282
commit
403291c191
|
@ -3180,8 +3180,12 @@ struct VulkanCommandQueue final : IGraphicsCommandQueue {
|
||||||
Log.report(logvisor::Fatal, FMT_STRING("texture provided to resolveDisplay() must have at least 1 color binding"));
|
Log.report(logvisor::Fatal, FMT_STRING("texture provided to resolveDisplay() must have at least 1 color binding"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ThrowIfFailed(
|
VkResult res =
|
||||||
vk::AcquireNextImageKHR(m_ctx->m_dev, sc.m_swapChain, UINT64_MAX, m_swapChainReadySem, nullptr, &sc.m_backBuf));
|
vk::AcquireNextImageKHR(m_ctx->m_dev, sc.m_swapChain, UINT64_MAX, m_swapChainReadySem, nullptr, &sc.m_backBuf);
|
||||||
|
if (res == VK_ERROR_OUT_OF_DATE_KHR) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
ThrowIfFailed(res);
|
||||||
VulkanContext::Window::SwapChain::Buffer& dest = sc.m_bufs[sc.m_backBuf];
|
VulkanContext::Window::SwapChain::Buffer& dest = sc.m_bufs[sc.m_backBuf];
|
||||||
|
|
||||||
VulkanDataFactoryImpl* dataFactory = static_cast<VulkanDataFactoryImpl*>(m_parent->getDataFactory());
|
VulkanDataFactoryImpl* dataFactory = static_cast<VulkanDataFactoryImpl*>(m_parent->getDataFactory());
|
||||||
|
@ -4077,7 +4081,12 @@ void VulkanCommandQueue::execute() {
|
||||||
present.pWaitSemaphores = &m_drawCompleteSem;
|
present.pWaitSemaphores = &m_drawCompleteSem;
|
||||||
present.pResults = nullptr;
|
present.pResults = nullptr;
|
||||||
|
|
||||||
ThrowIfFailed(vk::QueuePresentKHR(m_ctx->m_queue, &present));
|
VkResult res = vk::QueuePresentKHR(m_ctx->m_queue, &present);
|
||||||
|
if (res == VK_ERROR_OUT_OF_DATE_KHR) {
|
||||||
|
// ignore, resize deferred
|
||||||
|
} else {
|
||||||
|
ThrowIfFailed(res);
|
||||||
|
}
|
||||||
m_frameLimiter.Sleep(m_ctx->m_targetFrameTime);
|
m_frameLimiter.Sleep(m_ctx->m_targetFrameTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue