KhronosGroup / KhronosGroup/Vulkan-ValidationLayers
Use real command, not vkCmdDraw for queue submission checks
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1k
- Forks
- 505
- Avg merge
- 11h 25m
- Merged PRs (30d)
- 229
Description
Environment:
- OS: Win11
- GPU and driver version: RTX 5080 driver 576.28
- SDK or header version if building from repo: SDK 1.4.313.2
- Options enabled (synchronization, best practices, etc.): Core -> Image Layout, GPU-AV -> Image Layout, GPU-AV -> Postprocess descriptor indexing
Describe the Issue
see comment below - https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/10318#issuecomment-3029901242
validation layer: [ Debug region: TempBuildHzbPass ] vkQueueSubmit(): pSubmits[0].pSubmits[0].pSubmits[0].pSubmits[0].pSubmits[0].pSubmits[0] command buffer VkCommandBuffer 0x24bb86d6020[Frame 1] expects VkImage 0x2730000000273[IblPrefilterPass image] (subresource: aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, mipLevel = 0, arrayLayer = 0) to be in layout VK_IMAGE_LAYOUT_GENERAL--instead, current layout is VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL. (Detected from GPU-AV).
The Vulkan spec states: If a descriptor with type equal to any of VK_DESCRIPTOR_TYPE_SAMPLE_WEIGHT_IMAGE_QCOM, VK_DESCRIPTOR_TYPE_BLOCK_MATCH_IMAGE_QCOM, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, or VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT is accessed as a result of this command, all image subresources identified by that descriptor must be in the image layout identified when the descriptor was written (https://vulkan.lunarg.com/doc/view/1.4.313.2/windows/antora/spec/latest/chapters/drawing.html#VUID-vkCmdDraw-None-09600)
`
- The url is wrong. vkCmdDraw isnt used at all in the codebase. We use CmdDrawMeshTasksIndirect and CmdDrawMeshTasksIndirectCount. so if the error message isnt a false positive it could be https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdDrawMeshTasksIndirectCountEXT.html#VUID-vkCmdDrawMeshTasksIndirectCountEXT-None-09600
- The debug region is wrong, that debug region is completely unrelated to the VkImage
- What is
pSubmits[0].pSubmits[0].pSubmits[0].pSubmits[0].pSubmits[0].pSubmits[0]? - The error message is incorrect:
First the image cubemap is created once in a computer shader (general layout) in one commandbuffer and then only sampled in fragment and compute shaders in the following commandbuffers.
So it doesnt make sense that it complains about being in shader readonly.
The synchronisation and layouts were manually inspected to be correct.
This message only appreas if the three VVL option above are enabled.
Additional context
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.
Research direction
Start by reproducing the report with Core → Image Layout, GPU-AV → Image Layout, and GPU-AV → Postprocess descriptor indexing enabled. Trace the GPU-AV queue-submission check around the reported command-buffer message, debug region, nested pSubmits path, and image layout diagnostic. Done means the diagnostic uses the real command, identifies the correct debug region and submission path, and reports the correct image-layout result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100