vkGetImageMemoryRequirementsVkDevice
vkGetImageMemoryRequirements is a Vulkan function that returns the memory requirements for a specific VkImage object. It is used to determine how much memory to allocate for the image, what alignment is required, and which memory types are compatible, before binding memory to the image.
Prototype: void vkGetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements);
Parameters: device is the logical device, image is the image whose requirements are being queried, and pMemoryRequirements
VkMemoryRequirements contains three fields: size, alignment, and memoryTypeBits. size is the total number of bytes required
Usage notes: After creating an image, call vkGetImageMemoryRequirements to obtain the memory requirements. Allocate memory with
Variants: For extended scenarios, vkGetImageMemoryRequirements2 (and variant VK_KHR_get_image_memory_requirements2) provides a more flexible querying mechanism using VkImageMemoryRequirementsInfo2
See also: Vulkan memory management, vkAllocateMemory, vkBindImageMemory, VkMemoryRequirements.