Possible validation error in https://docs.vulkan.org/tutorial/latest/07_Depth_buffering.html
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- cpp
- Domain
- computer-graphics
Research direction
Start at the depth-buffering tutorial page and reproduce the issue by selecting only vk::Format::eD32SfloatS8Uint and vk::Format::eD24UnormS8Uint in the supported-format list. Inspect the depth image layout transition and verify that the aspect mask includes the required depth and stencil aspects, then rerun the tutorial with validation enabled to confirm the reported error is gone.
Written by the indexing model from the issue text.
Description
The aspect mask for the depth image layout transition is hardcoded to vk::ImageAspectFlagBits::eDepth
If, while choosing the depth image format, vk::Format::eD32Sfloat, is not selected, the program will cause this validation error:
Validation Error: [ VUID-VkImageMemoryBarrier2-image-03320 ] | MessageID = 0xb7ab59da
vkCmdPipelineBarrier2(): pDependencyInfo->pImageMemoryBarriers[0].image (VkImage 0xf000000000f) has depth/stencil format VK_FORMAT_D32_SFLOAT_S8_UINT, but its aspectMask is VK_IMAGE_ASPECT_DEPTH_BIT.
The Vulkan spec states: If image has a depth/stencil format with both depth and stencil and the separateDepthStencilLayouts feature is not enabled, then the aspectMask member of subresourceRange must include both VK_IMAGE_ASPECT_DEPTH_BIT and VK_IMAGE_ASPECT_STENCIL_BIT (https://docs.vulkan.org/spec/latest/chapters/synchronization.html#VUID-VkImageMemoryBarrier2-image-03320)
Objects: 2
[0] VkCommandBuffer 0x25a64390990
[1] VkImage 0xf000000000f
Steps to reproduce
Change
return findSupportedFormat({vk::Format::eD32Sfloat, vk::Format::eD32SfloatS8Uint, vk::Format::eD24UnormS8Uint},
vk::ImageTiling::eOptimal,
vk::FormatFeatureFlagBits::eDepthStencilAttachment);
To this
return findSupportedFormat({vk::Format::eD32SfloatS8Uint, vk::Format::eD24UnormS8Uint},
vk::ImageTiling::eOptimal,
vk::FormatFeatureFlagBits::eDepthStencilAttachment);
- Dominant language
- C++
- Stars
- 424
- Forks
- 127
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 5
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from KhronosGroup/Vulkan-Tutorial
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
KhronosGroup/Vulkan-Tutorial#519 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
KhronosGroup/Vulkan-Tutorial#511 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
KhronosGroup/Vulkan-Tutorial#508 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 74/100
KhronosGroup/Vulkan-Tutorial#499 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
KhronosGroup/Vulkan-Tutorial#498 ·
All issues in KhronosGroup/Vulkan-Tutorial
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
infiniflow/infinity#3502 ·