I'm studying Vulkan RenderPasses, for hobby.
I have the following descriptions for members of VkSubpassDependency struct. The verbiage is a combination of language from sources(books, spec, internet), and my own word-smithing. The descriptions might be wrong because of my messing with them.
// .srcSubpass:
// The subpass index from which "producing" operations should be finished before the second set of "consuming" operations executes.
// If there are no dependencies on previous subpasses(eg: first subpass), use VK_SUBPASS_EXTERNAL.
// .srcStageMask:
// A bitmask of the pipeline stages which produce the data read by the "consuming" commands.
// .srcAccessMask:
// The types of memory operations that occurred during the "producing" commands.
// ----------
// .dstSubpass:
// The index of the first subpass whose operations depend the output of this subpass; or VK_SUBPASS_EXTERNAL, if
// there are no destination subpasses dependencies.
// .dstStageMask:
// A bitmask of the pipeline stages which depend on the data generated by the "producing" commands.
// .dstAccessMask:
// The types of memory operations that will be performed in "consuming" commands.
I have some questions
Lets say that a RenderPass has 3 subpasses -- S1, S2, S3 -- which are "logically" executed in sequence, but which may be executed out of order by the GPU.
-
- srcSubpass:
- 1.1. Is it possible for there to be a scenario in which S3 does not depend on either S1 nor S2? Or do subsequent subpasses always depend on some previous pass?
- 1.2. If 1.1 is true, then
srcSubpasswould beVK_SUBPASS_EXTERNAL, correct? - 1.3. Or, does
VK_SUBPASS_EXTERNALonly ever apply to S1?
- 2. dstSubpass:
- 2.1. Is this simply always the index of the next logical subpass (ie: S1->S2)? Or is it possible for it to be S1->S3?
- 2.2. Similar to question 1.1, is it possible for S3 not to depend on S2, and thus this value would be
VK_SUBPASS_EXTERNALfor S2?
- 3. srcStageMask:
- 3.1. Is it the case that the earlier the pipeline stage is, the less the dependency between the 2 sets of operations would be?
That is, a
srcStageMaskofVK_PIPELINE_STAGE_VERTEX_INPUT_BITwould have a smaller dependency time thanVK_PIPELINE_STAGE_VERTEX_SHADER_BIT. - 3.2. If 3.1 is true, then this means that the ideal pipeline stage would be
VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, correct?
- 4. dstStageMask:
- 4.1. For a smaller dependency time between 2 sets of operations, the farther down the pipeline, the better?
- 4.2. If 4.1 is true, then
VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BITwould be the ideal stage, for minimum dependency. Yeah?
Thanks