Skip to content

Comments

Special treatment of UNDEFINED layout for external images to preserve contents#3713

Merged
baldurk merged 1 commit intobaldurk:v1.xfrom
apazylbe:discard
Oct 8, 2025
Merged

Special treatment of UNDEFINED layout for external images to preserve contents#3713
baldurk merged 1 commit intobaldurk:v1.xfrom
apazylbe:discard

Conversation

@apazylbe
Copy link
Contributor

@apazylbe apazylbe commented Oct 6, 2025

  • 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

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."

- 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
@baldurk baldurk merged commit 56ee544 into baldurk:v1.x Oct 8, 2025
16 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants