vkBindImageMemory
vkBindImageMemory is a Vulkan API function used to bind a memory object to a VkImage. It is a host-side operation that associates a VkDeviceMemory object with a specified image, enabling the image's storage to be backed by device memory for use in rendering and compute.
Used after creating an image, vkGetImageMemoryRequirements is typically called to determine the memorySize and memoryAlignment required
- device: the logical device that owns the image.
- image: the image to bind memory to.
- memory: the device memory object to bind to the image.
- memoryOffset: offset into the memory object at which the binding starts; must be a multiple of
- VK_ERROR_OUT_OF_HOST_MEMORY, VK_ERROR_OUT_OF_DEVICE_MEMORY when memory cannot be allocated or bound.
- VK_ERROR_MEMORY_MAP_FAILED, VK_ERROR_FRAGMENTED_POOL, or other error codes for valid failure conditions such as insufficient memory type compatibility
- An image should be bound only once with a given memory object, and the bound memory
- The operation is separate from command buffer submission and is performed via a direct API call
VkImage, VkDeviceMemory, vkGetImageMemoryRequirements, vkAllocateMemory.