@@ -111,7 +111,8 @@ void App::drawFrame()
111111 // because it kills the swapchain, so we skip frames in this case.
112112 if (nextSwapchainImage)
113113 {
114- auto [backbuffer, backbufferView, backbufferAvailableSem] = *nextSwapchainImage;
114+ auto [backbuffer, backbufferView, backbufferAvailableSem, backbufferReadyForPresent] =
115+ *nextSwapchainImage;
115116
116117 ETNA_CHECK_VK_RESULT (currentCmdBuf.begin (vk::CommandBufferBeginInfo{}));
117118 {
@@ -158,10 +159,14 @@ void App::drawFrame()
158159 ETNA_CHECK_VK_RESULT (currentCmdBuf.end ());
159160
160161 // We are done recording GPU commands now and we can send them to be executed by the GPU.
161- // Note that the GPU won't start executing our commands before the semaphore is
162- // signalled, which will happen when the OS says that the next swapchain image is ready.
163- auto renderingDone =
164- commandManager->submit (std::move (currentCmdBuf), std::move (backbufferAvailableSem));
162+ // Note that the GPU won't start executing our commands before the backbufferAvailableSem
163+ // semaphore is signalled, which will happen when the OS says that the next swapchain image is
164+ // ready, and the result image will be ready for present after backbufferReadyForPresent is
165+ // signalled by GPU
166+ auto renderingDone = commandManager->submit (
167+ std::move (currentCmdBuf),
168+ std::move (backbufferAvailableSem),
169+ std::move (backbufferReadyForPresent));
165170
166171 // Finally, present the backbuffer the screen, but only after the GPU tells the OS
167172 // that it is done executing the command buffer via the renderingDone semaphore.
0 commit comments