vblanco20-1 / vulkan-guide

Introductory guide to vulkan.
https://vkguide.dev/
MIT License
940 stars 213 forks source link

Usage of subpass dependencies for color attachments #63

Closed pixelcluster closed 2 years ago

pixelcluster commented 2 years ago

I was notified that in the current tutorial state, the section I added in #53 uses a subpass dependency for the color attachment without ever explaining it or showing code for the creation. This PR already fixes this by adding the code to create the dependency.

However, that code is inherited from previous chapters, but is (to my knowledge) never explained anywhere. In chapter 1, explanation of the pWaitDstStageMask parameter that, in combination with the subpass dependency, makes the subpass wait on the image acquire semaphore, is deferred to another chapter:

the .pWaitDstStageMask is a complex parameter. We are not going to explain it until we go into details of synchronization.

I haven't found the explanation for it in later chapters. I'd like this PR to fix this as well, though I'm not entirely sure in which chapter to place the explanation. Suggestions as to where this explanation should go are welcome.

xavier847 commented 2 years ago

Simply revisiting the subpass in Chapter 3 would help. Working through this tutorial, at some point it feels like too much to take in at once and it's just steamrolling forward. Going back and reiterating over the subpass and building the dependency when we come upon synchronization would be a nice refresh and seemed like the intention from the beginning.

pixelcluster commented 2 years ago

Yeah, Chapter 3 seems to be a good place for this. I'm not entirely sure if this would help with the tutorial feeling like it's "steamrolling forward" though, Vulkan's synchronization model isn't exactly easy to grasp.

pixelcluster commented 2 years ago

I'm marking the PR "ready for review" now, as the upcoming switch to 1.3 and dynamic rendering makes explanations about subpass dependencies obsolete and I think putting them into the tutorial now would be pretty much wasted effort.

For understanding how subpass dependencies work in the meantime, I guess one could check out vulkan-tutorial or ask about it in channels such as the Vulkan Discord.