Special treatment of UNDEFINED layout for external images to preserve contents#3713
Merged
baldurk merged 1 commit intobaldurk:v1.xfrom Oct 8, 2025
Merged
Special treatment of UNDEFINED layout for external images to preserve contents#3713baldurk merged 1 commit intobaldurk:v1.xfrom
baldurk merged 1 commit intobaldurk:v1.xfrom
Conversation
- Preserve the initial contents of UNDEFINED images if they are external - Don't consider a pipeline barrier from UNDEFINED a resource discard for external images Change-Id: Ife30e7c542a66668d681d492363a25745238119e
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
External images have to be created with VK_IMAGE_LAYOUT_UNDEFINED: "If the pNext chain includes a VkExternalMemoryImageCreateInfo or VkExternalMemoryImageCreateInfoNV structure whose handleTypes member is not 0, initialLayout must be VK_IMAGE_LAYOUT_UNDEFINED" (https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#VUID-VkImageCreateInfo-pNext-01443)
So even if image has contents that importing application would like to be preserved, it will have a transition from UNDEFINED to new layout.
This section https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#resources-external-sharing adds that "Therefore, the layout specified as part of this transition will be the true initial layout of the image. The undefined layout specified when creating it is a placeholder to simplify valid usage requirements."