I fully understand what the code means, but i am asking myself why i never saw this so far in other code-samples. Is this really necessary?
i dont doing anything like this in my engine and it works fine. Rendering/Presenting is syncronized with two semaphores (He is actually doing the same thing).
Yea i know, i understand what this code does. But why i never seen anything like that in other tutorials / code samples? Basically this dependencies say’s that the presentation engine should not read until the color-writes are complete and vice versa that the application should not write until the reads are complete. At least i think that is what he is intented to do. But aren’t the two semaphores already does this kind of synchronization?
The External to 0 is necessary if you want to use semaphores for syncing acquire with render as otherwise the transition from present/undefined to color_attachment is could begin before the semaphore is signaled (it only blocks specific stages and transitions don’t have a stage).
The post render dependency is not necessary as the semaphore itself has enough implicit memory dependency to be correct…
At least for my examples I plan on using subpass dependencies in different places. The reason that most people (including myself) are using semaphores instead of subpass dependencies is because subpasses are a concept new to Vulkan. And the LunarG API examples didn’t use them (upon release) anyway, and I guess that’s where most people that wrote examples and tutorials started with
But after playing around with sub pass dependencies I’d prefer them in several places and plan on adding them at some point.