VKCMDBINDINDEXBUFFER(3)

NAME
vkCmdBindIndexBuffer - Bind an index buffer to a command buffer.

C SPECIFICATION

    void vkCmdBindIndexBuffer(
        VkCommandBuffer                             commandBuffer,
        VkBuffer                                    buffer,
        VkDeviceSize                                offset,
        VkIndexType                                 indexType);

PARAMETERS

commandBuffer
    Specifies the command buffer to which to bind the index buffer.

buffer
    The buffer object to bind.

offset
    The offset from the start of the buffer object where index data begins.

indexType
    The type of the index data stored in the buffer.

DESCRIPTION

vkCmdBindIndexBuffer binds the buffer object specified by buffer, starting at the byte offset specified in offset as an index buffer on the graphics pipeline bind point on commandBuffer. indexType specifies the type of the index data and must be one of VK_INDEX_TYPE_UINT16 or VK_INDEX_TYPE_UINT32, to indicate 16- or 32-bit unsigned data, respectively.

If indexType is VK_INDEX_TYPE_UINT16, then offset must be a multiple of two. If indexType is VK_INDEX_TYPE_UINT32, then offset must be a multiple of four.

VALID USAGE

    • commandBuffer must be a valid VkCommandBuffer handle

    • buffer must be a valid VkBuffer handle

    • indexType must be a valid VkIndexType value

    • commandBuffer must be in the recording state

    • The VkCommandPool that commandBuffer was allocated from must support graphics operations

    • Each of commandBuffer and buffer must have been created, allocated or retrieved from the same VkDevice

    • offset must be less than the size of buffer

    • The sum of offset, and the address of the range of VkDeviceMemory object that’s backing buffer, must be a multiple of the type indicated by indexType

    • buffer must have been created with the VK_BUFFER_USAGE_INDEX_BUFFER_BIT flag

HOST SYNCHRONIZATION

    • Host access to commandBuffer must be externally synchronized

COMMAND PROPERTIES
Command Buffer Levels | Render Pass Scope | Supported Queue Types
Primary Secondary | Both | GRAPHICS

NOTES

Although vkCmdBindIndexBuffer does not generate errors or return a value, enabled validation layers may detect possible error conditions or potentially undefined behavior and report this via some other means.

SEE ALSO

vkCmdDrawIndexed

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.