KhronosGroup / KhronosGroup/Vulkan-ValidationLayers

VUID-VkDescriptorImageInfo-imageLayout-00344 false positive

Open
#8,407 1 comment 0 reactions 0 assignees View on GitHub
ImageLayout
Dominant language
C++
Stars
1k
Forks
504
Avg merge
11h 35m
Merged PRs (30d)
224

Description

**Environment:**
- OS: Windows 11
- GPU and driver version: AMD Radeon RX 6950 XT, 2.0.299
- SDK or header version if building from repo: 1.3.290.0
- Options enabled (synchronization, best practices, etc.): Image Layout

**Describe the Issue**

Here I have two dispatches separated by an image barrier:
![image](https://github.com/user-attachments/assets/46e7f892-dc66-4fea-acf4-d4139cb000ce)
The barrier looks like this:
![image](https://github.com/user-attachments/assets/2e460f6e-6867-4a5b-adca-c69659b78dbc)

The first dispatch writes to mip 1, the barrier transitions it from `VK_IMAGE_LAYOUT_GENERAL` to `VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL`, and the second dispatch reads from mip 1.

Both shaders access the mips like this:
```glsl
layout(set = 0, binding = 25) uniform texture2D framebufferTextureMips[];
layout(set = 0, binding = 26, rgba16f) uniform image2D framebufferImageMips[];
```

Both arrays are backed by the same array of image views, each pointing to a single mip. The texture descriptors are updated with `VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL` and the image ones with `VK_IMAGE_LAYOUT_GENERAL`.

Afaik, my usage here is correct, but at the second dispatch call I get a validation error, saying that the layout of mip 1 is still `VK_IMAGE_LAYOUT_GENERAL` despite the barrier before the call.

**Expected behavior**

No validation error.

**Valid Usage ID**
> VUID-VkDescriptorImageInfo-imageLayout-00344(ERROR / SPEC): msgNum: -564812795 - Validation Error: [ VUID-VkDescriptorImageInfo-imageLayout-00344 ] Object 0: handle = 0x1c737122030, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x2b424a0000000034, name = frameBufferImage, type = VK_OBJECT_TYPE_IMAGE; | MessageID = 0xde55a405 | vkCmdDispatch(): Cannot use VkImage 0x2b424a0000000034[frameBufferImage] (layer=0 mip=1) with specific layout VK_IMAGE_LAYOUT_GENERAL that doesn't match the previous known layout VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL. The Vulkan spec states: imageLayout must match the actual VkImageLayout of each subresource accessible from imageView at the time this descriptor is accessed as defined by the image layout matching rules (https://vulkan.lunarg.com/doc/view/1.3.290.0/windows/1.3-extensions/vkspec.html#VUID-VkDescriptorImageInfo-imageLayout-00344)

Contributor guide

Open the contributing guide

Research direction

Start at the vkCmdDispatch validation path for VUID-VkDescriptorImageInfo-imageLayout-00344 and trace how the image-view mip layout is tracked across the reported barrier. Reproduce the descriptor-array case described in the issue; done means the second dispatch no longer reports a layout mismatch when mip 1 was transitioned before access.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.