The specs say under 7.1 Render Pass Creation that if there is no subpass dependency specified, an implicit dependency exists. It is stated that the implicit dependency is analogous to the following for the dependency which synchronizes firstSubpass with whatever comes before:
VkSubpassDependency implicitDependency = {
.srcSubpass = VK_SUBPASS_EXTERNAL;
.dstSubpass = firstSubpass; // First subpass attachment is used in
.srcStageMask = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT;
.dstStageMask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT;
.srcAccessMask = 0;
.dstAccessMask = VK_ACCESS_INPUT_ATTACHMENT_READ_BIT |
VK_ACCESS_COLOR_ATTACHMENT_READ_BIT |
VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT |
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT |
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT;
.dependencyFlags = 0;
};
Now top of the pipe is stated as the source mask here. Doesn’t this mean that there is effectively no synchronization at all, because top of the pipe of whatever comes before is actually the beginning of whatever comes before, right? So the rest of whatever comes before would be allowed to overlap with my firstSubpass. Do I get this right?
Does all of that just mean that if you do not set up a subpass dependency, there will be no synchronization at all?
What I actually wanted to achieve in a framework that I am developing is a default dependency which is overaggressive in synchronization, i.e. it would synchronize the bottom of the pipe of whatever comes before with the top of the pipe of my firstSubpass. But with that, I have another difficulty. However, I think it is better to ask that in a separate question.