VKBINDIMAGEMEMORY(3)

NAME
vkBindImageMemory - Bind device memory to an image object

C SPECIFICATION

To attach memory to an image object, call:

    VkResult vkBindImageMemory(
        VkDevice                                    device,
        VkImage                                     image,
        VkDeviceMemory                              memory,
        VkDeviceSize                                memoryOffset);

PARAMETERS

    • device is the logical device that owns the image and memory.

    • image is the image.

    • memory is the a VkDeviceMemory object describing the device memory to attach.

    • memoryOffset is the start offset of the region of memory which is to be bound to the image. The number of bytes returned in the VkMemoryRequirements::size member in memory, starting from memoryOffset bytes, will be bound to the specified image.

DESCRIPTION
Valid Usage

    • image must not already be backed by a memory object

    • image must not have been created with any sparse memory binding flags

    • memoryOffset must be less than the size of memory

    • memory must have been allocated using one of the memory types allowed in the memoryTypeBits member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements with image

    • memoryOffset must be an integer multiple of the alignment member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements with image

    • The size member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements with image must be less than or equal to the size of memory minus memoryOffset
Valid Usage (Implicit)

    • device must be a valid VkDevice handle

    • image must be a valid VkImage handle

    • memory must be a valid VkDeviceMemory handle

    • image must have been created, allocated, or retrieved from device

    • memory must have been created, allocated, or retrieved from device
Host Synchronization

    • Host access to image must be externally synchronized
Return Codes

On success, this command returns

        • VK_SUCCESS

On failure, this command returns

        • VK_ERROR_OUT_OF_HOST_MEMORY

        • VK_ERROR_OUT_OF_DEVICE_MEMORY

SEE ALSO

VkDevice, VkDeviceMemory, VkDeviceSize, VkImage

DOCUMENT NOTES

For more information, see the Vulkan Specification at URL

https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkBindImageMemory

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification,not directly.

COPYRIGHT

Copyright (c) 2014-2016 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.

AUTHOR

Khronos Group
    Author.