VulkanMemoryAllocator icon indicating copy to clipboard operation
VulkanMemoryAllocator copied to clipboard

Validation warns `VkBindImagePlaneMemoryInfo` miss for `VK_IMAGE_CREATE_DISJOINT_BIT` images

Open psionic12 opened this issue 1 year ago • 1 comments

For example:

    VkImageCreateInfo imageCreateInfo = {};
    imageCreateInfo.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO;
    imageCreateInfo.imageType = VK_IMAGE_TYPE_2D;
    imageCreateInfo.format = VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM;
    imageCreateInfo.flags = VK_IMAGE_CREATE_DISJOINT_BIT;

If calling vmaCreateImage() with this image create info, the validate layer will warn about this:

vkBindImageMemory(): In order to bind planes of a disjoint image, add a VkBindImagePlaneMemoryInfo structure to the pNext chain of VkBindImageMemoryInfo.

psionic12 avatar Sep 20 '23 06:09 psionic12

Planar / disjoint images are not currently supported by VMA. Support may be added the future - thank you for this feature request.

You can use VMA to allocate memory for for such image, but you need to use lower-level functions:

  • Create the image using pure Vulkan vkCreateImage, call vkGetImageMemoryRequirements2 etc...
  • Allocate memory using function vmaAllocateMemory.
  • Bind image to memory using function vmaBindImageMemory2. You have an opportunity to pass pNext pointer there, which allows to attach required structure VkBindImagePlaneMemoryInfo.

adam-sawicki-a avatar Sep 20 '23 10:09 adam-sawicki-a