KhronosGroup / KhronosGroup/Vulkan-ValidationLayers
Missing validation on usage of VK_IMAGE_LAYOUT_PRESENT_SRC_KHR
- Dominant language
- C++
- Stars
- 1k
- Forks
- 504
- Avg merge
- 11h 35m
- Merged PRs (30d)
- 224
Description
**Issue description:**
I found an application transitioning a depth image view in a render pass to layout `VK_IMAGE_LAYOUT_PRESENT_SRC_KHR`
https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkImageLayout.html says that `VK_IMAGE_LAYOUT_PRESENT_SRC_KHR must only be used for presenting a presentable image for display` and I know our implementation (Intel/Mesa) doesn't allow creation swapchain with depth formats so this is invalid.
**Please include the valid usage IDs for the checks you are requesting:**
Unfortunately there is no VU for this explicitly for this. But I think this falls under at least those 2 VU:
```
VUID-VkAttachmentDescription-initialLayout-parameter
initialLayout must be a valid [VkImageLayout](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkImageLayout.html) value
VUID-VkAttachmentDescription-finalLayout-parameter
finalLayout must be a valid [VkImageLayout](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkImageLayout.html) value
```
Along with the description of the layout :
```
VK_IMAGE_LAYOUT_PRESENT_SRC_KHR must only be used for presenting a presentable image for display.
```
**Any additional information:**
N/A
Contributor guide
Research direction
Start with validation for VkAttachmentDescription initialLayout and finalLayout, then consult the VkImageLayout specification for the restriction on VK_IMAGE_LAYOUT_PRESENT_SRC_KHR. Done means invalid use of this layout is reported with an appropriate valid-usage check and covered by validation tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100