Comment usage of waitIdle in chapter 15#207
Conversation
|
Yep, definitely a good change. |
6ab0ac4 to
41bb083
Compare
I just realized, that none of the other chapters use |
|
Prob. something that's generally wrong in the tutorial: I think we also need to have a vector for the presentCompleteSemaphore semaphores that's sized by max. no of frames in flight. See #65 |
|
IIRC the wait idle is because frames in flight hasn't been introduced yet. So it is there to make sure everything behave correctly with only one semaphore for acquire and one for present. |
That sounds reasonable! |
|
The waitIdle is mentioned in the documentation side of the tutorial. But yes, that mention should at least add some detail on that and tell readers that waididle shouldn't be used. |
|
Agreed, waitIdle should have been better described. I would be 100% for replacing waitIdle with proper usage of semaphores, especially the present semaphore array with size of swapchain image count. In fact, since it is best practice to have swapchain image count present semaphores, it would be better to only ever introduce present semaphores as an array (never as a single object) because the usage of the semaphore escapes outside of the applications direct control. I commented initially just to give context why, but I do not want to claim that it is the only way things must be done 😄 |
charles-lunarg
left a comment
There was a problem hiding this comment.
Approving to mark that I agree with the intent of the changes. (I did not heavily review the content for full clarity).
|
If we agree on this, documentation also needs to be updated to reflect this change. |
|
I 100% agree! Will need to update documentation. Sorry didn't have internet over the weekend; just now catching up. |
|
I reverted most of my changes, as the use of multiple semaphores is introduced in the next chapter. |
You definitely don't need to
device.waitIdle()after every frame. It's enough to wait incleanup()(Well, with caution, see VK_EXT_swapchain_maintenance1 extension).The
queue.waitIdle()indrawFrame()is not needed, when you haveswapChainImages.size()renderFinishedSemaphores.If this is considered to be ok, I can carry that change to all the other chapters.