Hi I have questions about vulkan pipeline stages.

Spec(https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkPipelineStageFlagBits.html) explains VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT and VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT as below.

  • VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT specifies the stage of the pipeline after blending where the final color values are output from the pipeline. This stage includes blending, logic operations, render pass load and store operations for color attachments, render pass multisample resolve operations, and vkCmdClearAttachments.

  • VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT specifies the stage of the pipeline where early fragment tests (depth and stencil tests before fragment shading) are performed. This stage also includes render pass load operations for framebuffer attachments with a depth/stencil format.

If I use resources as shown below, does the Pipeline barrier need to guarantee termination of the previous pipeline before Begin renderpass Clear?

Case 1

DRAW (Use Color attachment [0] as texture)

Barrier (src - VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, dst - VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT

End renderpass

Begin Renderpass ( RP load op clear attachment [0] )

Case 2

DRAW (Use Depth stencil attachment [1] as texture)

Barrier (src - VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, dst - VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT

End renderpass

Begin Renderpass ( RP load op clear attachment [1] )

In both case 1 and case 2, Can we prevent Clear from starting due to a pipeline barrier in the spec ?? When I read the contents of the spec, it seems more natural for these two BITs to be in Subpass dependency rather than Barrier... So i'm confused

Check spec, and want to know exact operations

0

There are 0 best solutions below