0

The Render Pass dependency from the well-known Vulkan tutorial from Sascha Willems looks like this:

.srcSubpass = VK_SUBPASS_EXTERNAL;
.dstSubpass = 0;
.srcStageMask =
  VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | 
  VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
.srcAccessMask = 0;
.dstStageMask =
  VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT |
  VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
.dstAccessMask =
  VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT |
  VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;

The question is, why do we specify EARLY_FRAGMENT stage in srcStageMask? We are waiting for the COLOR_ATTACHMENT stage to complete, which means that all earlier render stages (including EARLY_FRAGMENT) will also be completed - isn't that enough?

4
  • Precisely which sample and which render pass? What stage masks are needed will depend on what the render pass is doing in that specific instance. Commented Jun 8 at 20:50
  • 1
    In general I'd say that srcStageMask=EARLY_FRAGMENT_TESTS does seem odd for a source though. Depth/stencil is specified to be written at LATE_FRAGMENT_TESTS, so you can't safely "source" from EARLY unless it's read-only, at which point you're not really sourcing anything because it must already be in memory. Commented Jun 8 at 20:55
  • I got this from vulkan-tutorial.com. This is the main (and only) render pass (color+depth). But let me rephrase the question: doesn't the above code, regardless of context, mean the following: all stages from the srcStageMask must be completed before the stages from the dstAccessMask? If so, then EARLY_FRAGMENT stage from the srcStageMask will be completed before the COLOR_ATTACHMENT anyway, and we don't need to specify it? And yes, I mean only the completion of stages, without memory availability. Commented Jun 10 at 7:57
  • 1
    That would be my understanding too, yes ... Commented Jun 10 at 19:09

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.