Skip to content
Snippets Groups Projects
Verified Commit 5ec564b2 authored by Tobias Frisch's avatar Tobias Frisch
Browse files

Drop frames to avoid crash!

parent b53fd190
No related branches found
No related tags found
1 merge request!12Resolve "Swapchain Class"
Pipeline #24808 passed
...@@ -324,8 +324,17 @@ namespace vkcv ...@@ -324,8 +324,17 @@ namespace vkcv
uint32_t swapchainImageIndex; uint32_t swapchainImageIndex;
m_Context.getDevice().acquireNextImageKHR(m_swapchain.getSwapchain(), 0, nullptr, m_Context.getDevice().acquireNextImageKHR(m_swapchain.getSwapchain(), 0, nullptr,
m_SyncResources.swapchainImageAcquired, &swapchainImageIndex, {}); m_SyncResources.swapchainImageAcquired, &swapchainImageIndex, {});
const uint64_t timeoutPeriodNs = 1000; // TODO: think if is adequate const uint64_t timeoutPeriodNs = 100000; // TODO: think if is adequate
m_Context.getDevice().waitForFences(m_SyncResources.swapchainImageAcquired, true, timeoutPeriodNs);
const auto& result = m_Context.getDevice().waitForFences(m_SyncResources.swapchainImageAcquired, true, timeoutPeriodNs);
if (result == vk::Result::eTimeout) {
std::cerr << "Drop frame!" << std::endl;
m_CommandResources.commandBuffer.end();
return; // TODO: image gets dropped... ooops
}
m_Context.getDevice().resetFences(m_SyncResources.swapchainImageAcquired); m_Context.getDevice().resetFences(m_SyncResources.swapchainImageAcquired);
const auto swapchainImages = m_Context.getDevice().getSwapchainImagesKHR(m_swapchain.getSwapchain()); const auto swapchainImages = m_Context.getDevice().getSwapchainImagesKHR(m_swapchain.getSwapchain());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment