KhronosGroup / KhronosGroup/Vulkan-ValidationLayers
GPU-AV: false positive on descriptor indexing
@spencer-lunarg is already working on this.
Since Dec 2, 2025.
- Dominant language
- C++
- Stars
- 1k
- Forks
- 505
- Avg merge
- 11h 25m
- Merged PRs (30d)
- 229
Description
Environment:
- OS: Windows 11
- GPU and driver version: Nvidia RTX 5060 Ti, Version 581.80
- SDK or header version if building from repo: Vulkan SDK 1.4.328.1
- Options enabled (synchronization, best practices, etc.): GPU-Assisted Preset
Describe the Issue
When running the GPU-assisted validation preset, the game renders properly but validation errors are reported when accessing bindless image descriptors in an indirect draw command.
These are aliased entries in the HLSL shader, as you would expect from most bindless texture implementations:
[[ vk::binding( 0, BINDLESS_DESCRIPTOR_SET_INDEX ) ]] Texture2D<float4> g_bindless_texture2D_float4[ BINDLESS_TEXTURE_COUNT ];
[[ vk::binding( 0, BINDLESS_DESCRIPTOR_SET_INDEX ) ]] Texture2D<float> g_bindless_texture2D_float[ BINDLESS_TEXTURE_COUNT ];
[[ vk::binding( 0, BINDLESS_DESCRIPTOR_SET_INDEX ) ]] Texture3D<float4> g_bindless_texture3D_float4[ BINDLESS_TEXTURE_COUNT ];
[[ vk::binding( 0, BINDLESS_DESCRIPTOR_SET_INDEX ) ]] Texture3D<float> g_bindless_texture3D_float[ BINDLESS_TEXTURE_COUNT ];
[[ vk::binding( 0, BINDLESS_DESCRIPTOR_SET_INDEX ) ]] Texture3D<uint> g_bindless_texture3D_uint[ BINDLESS_TEXTURE_COUNT ];
The validation layers complain about the following:
vkCmdDrawIndexedIndirectCount(): the sampled image descriptor [VkDescriptorSet 0x19a6b5a74c8[Bindless (frame 0)], Set 1, Binding 0, Index 3721, variable "g_globalWindMap"] VkImageViewType is VK_IMAGE_VIEW_TYPE_2D but the OpTypeImage has (Dim = 3D) and (Arrayed = 0).
Either fix in shader or update the VkImageViewType to VK_IMAGE_VIEW_TYPE_3D
The Vulkan spec states: If a VkImageView is accessed as a result of this command, then the image view's viewType must match the Dim operand of the OpTypeImage as described in Compatibility Between SPIR-V Image Dimensions and Vulkan ImageView Types (https://vulkan.lunarg.com/doc/view/1.4.328.1/windows/antora/spec/latest/chapters/drawing.html#VUID-vkCmdDrawIndexedIndirectCount-viewType-07752)
The error message further points to a location in our shader which doesn't match the location where "g_globalWindMap" is being sampled. So effectively the error message doesn't make much sense.
The error seems to only show up when both "g_bindless_texture2D" and "g_bindless_texture3D" are accessed in the shader code. Removing one or the other makes the issue disappear.
Interestingly enough, changing binding indices seems to also "fix" the issue. This is very similar to the issue reported here.
To further check that this is in fact a bug in the validation layers, we have also added some extra validation from our side: we added a buffer that writes down the image type when the descriptors get updated and our sampling code would then only sample the image if the type matches. The issue was still present.
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.
Assessment
This issue has not been assessed yet.