KhronosGroup / KhronosGroup/Vulkan-Docs

[wiki]Extraneous stage and access flags in depth clear\reuse example

Open
#2,055 8 comments 0 reactions 1 assignee Claimed by @Tobski View on GitHub
Dominant language
JavaScript
Stars
3.3k
Forks
549
Avg merge
5d 5h
Merged PRs (30d)
2

Description

There are extraneous stage and access bits in the following depth clear\reuse example

https://github.com/KhronosGroup/Vulkan-Docs/wiki/Synchronization-Examples#first-render-pass-writes-to-a-depth-attachment-second-render-pass-re-uses-the-same-depth-attachment

> ```
> VkSubpassDependency dependency = {
> .srcSubpass = VK_SUBPASS_EXTERNAL,
> .dstSubpass = 0,
> .srcStageMask = VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT |
> VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT, // Both stages might have access the depth-buffer, so need both in src/dstStageMask
> .dstStageMask = VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT |
> VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT,
> .srcAccessMask = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT,
> .dstAccessMask = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT
> .dependencyFlags = 0};
> ```

Load op `VK_ATTACHMENT_LOAD_OP_CLEAR` for depth are performed in `VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT` with `VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT`. Therefore `dst` of `VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT` and `VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT` should be redundant.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.