GPUOpen-LibrariesAndSDKs / VulkanMemoryAllocator

Easy to integrate Vulkan memory allocation library
MIT License
2.63k stars 359 forks source link

vmaCreateImage() fails when using VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT #371

Open Stef-2 opened 1 year ago

Stef-2 commented 1 year ago

When attempting to create an image with VkImageUsageFlagBits::VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT provided by the recently released VK_EXT_host_image_copy, VMA returns a VK_ERROR_FEATURE_NOT_PRESENT error.

Inspecting further into what is happening under the hood, it looks like FindMemoryTypeIndex() is the one returning this error code.

adam-sawicki-a commented 1 year ago

I think it is most likely not a VMA fault. To check this, please create your image using vkCreateImage, then call vkGetImageMemoryRequirements, inspect bit flags in VkMemoryRequirements::memoryTypeBits and check whether the image with given creation parameters can be created in any of the memory types that meet your criteria.

Please also make sure you don't pass unnecessary flags to VmaAllocationCreateInfo. Leave it all zeros and see if it helps.