VKBINDIMAGEMEMORY(3)

NAME
vkBindImageMemory - Bind device memory to an image object

C SPECIFICATION

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

PARAMETERS

device
    A handle to the device that owns the object to which memory will be bound.

image
    A handle to the object to which to bind memory.

memory
    A handle to the device memory object.

memoryOffset
    The offset within the device memory object at which the binding should begin.

DESCRIPTION

vkBindImageMemory binds a region of the device memory object specified by memory to the resource image specified by image. image must be the handle of an image resource.

memoryOffset specifies the offset within memory, in bytes, from which the binding will begin. The value of memoryOffset must satisfy the alignment requirments of the image specified in image. This value is returned in the alignment member of the VkMemoryRequirements retrieved by calling vkGetImageMemoryRequirements with with image as specified.

vkBindImageMemory should be used only for non-sparse resources. Memory is bound to sparse imagesby calling vkQueueBindSparse.

VALID USAGE

    • 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

    • Each of device, image and memory must have been created, allocated or retrieved from the same VkPhysicalDevice

    • 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

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

vkQueueBindSparse

COPYRIGHT

Copyright © 2014-2016 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.

AUTHOR

Khronos Group
    Author.