You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
auto Swapchain::present(vk::Queue const queue, vk::Semaphore const to_wait)
61
-
-> bool {
62
-
auto const image_index = static_cast<std::uint32_t>(m_image_index.value());
63
-
auto present_info = vk::PresentInfoKHR{};
64
-
present_info.setSwapchains(*m_swapchain)
65
-
.setImageIndices(image_index)
66
-
.setWaitSemaphores(to_wait);
67
-
auto const result = queue.presentKHR(&present_info);
68
-
m_image_index.reset();
69
-
return !needs_recreation(result);
63
+
-> bool {
64
+
auto const image_index = static_cast<std::uint32_t>(m_image_index.value());
65
+
auto present_info = vk::PresentInfoKHR{};
66
+
present_info.setSwapchains(*m_swapchain)
67
+
.setImageIndices(image_index)
68
+
.setWaitSemaphores(to_wait);
69
+
// avoid VulkanHPP ErrorOutOfDateKHR exceptions by using alternate API.
70
+
auto const result = queue.presentKHR(&present_info);
71
+
m_image_index.reset();
72
+
return !needs_recreation(result);
70
73
}
71
74
```
72
75
73
76
It is the responsibility of the user (`class App`) to recreate the Swapchain on receiving `std::nullopt` / `false` return values for either operation. Users will also need to transition the layouts of the returned images between acquire and present operations. Add a helper to assist in that process, and extract the Image Subresource Range out as a common constant:
0 commit comments