Specifying dependencies between subpasses
When operations in a given subpass depend on the results of operations in one of the earlier subpasses in the same render pass, we need to specify subpass dependencies. This is also required if there are dependencies between operations recorded within a render pass and those performed before it, or between operations that are executed after a render pass and those performed within the render pass. It is also possible to define dependencies within a single subpass.
Note
Defining subpass dependencies is similar to setting up memory barriers.
How to do it...
- Create a variable of type
std::vector<VkSubpassDependency>
namedsubpass_dependencies
. For each dependency, add a new element to thesubpass_dependencies
vector and use the following values for its members:- The index of a subpass from which ("producing") operations should be finished before the second set of ("consuming") operations (or a
VK_SUBPASS_EXTERNAL
value for commands before the render...
- The index of a subpass from which ("producing") operations should be finished before the second set of ("consuming") operations (or a