Vulkan-ValidationLayers icon indicating copy to clipboard operation
Vulkan-ValidationLayers copied to clipboard

Missing validation on usage of VK_IMAGE_LAYOUT_PRESENT_SRC_KHR

Open llandwerlin-intel opened this issue 3 years ago • 1 comments

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

llandwerlin-intel avatar Jul 14 '22 11:07 llandwerlin-intel

Found the same violation in code samples of Mastering-Graphics-Programming-with-Vulkan book. Tested on Windows. Issue: https://github.com/PacktPublishing/Mastering-Graphics-Programming-with-Vulkan/issues/22

dorian-apanel-intel avatar Mar 09 '23 12:03 dorian-apanel-intel