KhronosGroup / KhronosGroup/Vulkan-Docs
A few question about readonly depth/stencil attachment, and sampling from the image in the same pass
- Dominant language
- JavaScript
- Stars
- 3.3k
- Forks
- 549
- Avg merge
- 5d 5h
- Merged PRs (30d)
- 2
Description
When I am using readonly depth/stencil attachment (sample the image from shaders as well in the same render pass) in WebGPU, I came across a few problems according to current Vulkan spec:
1. STORE_OP_NONE should be in core (not extension) for readonly depth/stencil attachment.
depth/stencil readonly image (which will use image layout like VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL, and access flag like VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT) has already been there since Vulkan 1.0 core. However, there is no STORE_OP_NONE in Vulkan core. And the validation rules say that all current storeOps (VK_ATTACHMENT_STORE_OP_STORE and VK_ATTACHMENT_STORE_OP_DONT_CARE) requires `VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT`. So if I am going to use readonly depth/stencil attachment with `DEPTH_STENCIL_ATTACHMENT_READ_BIT`, which is a core feature, I cannot correctly specify a storeOp in core. I can only rely on extensions which provide STORE_OP_NONE (like STORE_OP_NONE_EXT or STORE_OP_NONE_QCOM).
2. VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL image layout should be compatible with VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL, see the problem and PR at https://github.com/KhronosGroup/Vulkan-Docs/pull/1699
3. some minor changes about depth/stencil readonly image layout. See PR at https://github.com/KhronosGroup/Vulkan-Docs/pull/1698
I noticed that there is a discussion before: https://github.com/KhronosGroup/Vulkan-Docs/issues/1345. It looks like the spec has been revised and some problems has been addressed since that time. But I feel like that the detailed changes above on spec still need to be clarified.
Questions / PRs I mentioned above are some literal/verbal changes in spec, in order to resolve the conflicts and validation errors when I use the feature. However, I don't know the impact under the hood (like the impact on hardware). So I'd like to hear the thoughts from Vulkan community.
Contributor guide
Research direction
Start by reviewing the Vulkan spec concerns in this issue and the referenced Vulkan-Docs PRs 1699 and 1698, then compare them with issue 1345. Done means the readonly depth/stencil attachment behavior and image-layout wording are clarified without the reported conflicts or validation errors, with the hardware-impact questions resolved by the Vulkan community.
Written by the indexing model from the issue text.
Assessment
- Domain
- computer-graphics, documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100