I am following Overvoorde's Vulkan tutorial. When we wait for the acquired image we wait before the color output stage and we don't want to transition the layout of that image before it is available, so we do this:
srcSubpass = VK_SUBPASS_EXTERNAL;
dstSubpass = 0;
srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT
srcAccessMask = 0
dstStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT
dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT.
Which is also described in the specs here: https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#synchronization-semaphores-waiting
- My question is, are we waiting for all previous render passes to be done with their color output stage? Or does the driver know to wait only for the render passes that operate on the image we are operating on?
We could have acquired an image that finished its color output stage long ago but there may still be previously submitted render passes working on other images.
So, does this subpass dependency make us wait for all previous render passes or does it know that the render pass previously working on our image is done and the transition can happen immediately.
- What is the color output stage, does include the presentation. When is the color output stage finished?