VulkanMemoryAllocator
VulkanMemoryAllocator copied to clipboard
Validation warns `VkBindImagePlaneMemoryInfo` miss for `VK_IMAGE_CREATE_DISJOINT_BIT` images
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.
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
, callvkGetImageMemoryRequirements2
etc... - Allocate memory using function
vmaAllocateMemory
. - Bind image to memory using function
vmaBindImageMemory2
. You have an opportunity to passpNext
pointer there, which allows to attach required structureVkBindImagePlaneMemoryInfo
.