VKBINDBUFFERMEMORY(3)

NAME
vkBindBufferMemory - Bind device memory to a buffer object

C SPECIFICATION

    VkResult vkBindBufferMemory(
        VkDevice                                    device,
        VkBuffer                                    buffer,
        VkDeviceMemory                              memory,
        VkDeviceSize                                memoryOffset);

PARAMETERS

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

buffer
    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

vkBindBufferMemory binds a region of the device memory object specified by memory to the resource buffer specified by buffer. buffer must be the handle of a buffer 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 object specified in buffer. This value is returned in the alignment member of the VkMemoryRequirements retrieved by calling vkGetBufferMemoryRequirements with with buffer as specified.

vkBindBufferMemory should be used only for non-sparse resources. Memory is bound to sparse buffers by calling vkQueueBindSparse.

VALID USAGE

    • device must be a valid VkDevice handle

    • buffer must be a valid VkBuffer handle

    • memory must be a valid VkDeviceMemory handle

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

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

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

    • buffer must not already be backed by a memory object

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

    • memoryOffset must be less than the size of memory

    • If buffer was created with the VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT or VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT, memoryOffset must be a multiple of VkPhysicalDeviceLimits::minTexelBufferOffsetAlignment

    • If buffer was created with the VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, memoryOffset must be a multiple of VkPhysicalDeviceLimits::minUniformBufferOffsetAlignment

    • If buffer was created with the VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, memoryOffset must be a multiple of VkPhysicalDeviceLimits::minStorageBufferOffsetAlignment

    • 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 vkGetBufferMemoryRequirements with buffer

    • The size of buffer must be less than or equal to the size of memory minus memoryOffset

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

HOST SYNCHRONIZATION

    • Host access to buffer 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.