VKCMDBINDINDEXBUFFER(3)

NAME
vkCmdBindIndexBuffer - Bind an index buffer to a command buffer

C SPECIFICATION

To bind an index buffer to a command buffer, call:

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

PARAMETERS

    • commandBuffer is the command buffer into which the command is recorded.

    • buffer is the buffer being bound.

    • offset is the starting offset in bytes within buffer used in index buffer address calculations.

    • indexType selects whether indices are treated as 16 bits or 32 bits. Possible values include:

        typedef enum VkIndexType {
            VK_INDEX_TYPE_UINT16 = 0,
            VK_INDEX_TYPE_UINT32 = 1,
        } VkIndexType;

DESCRIPTION
Valid Usage

    • offset must be less than the size of buffer

    • The sum of offset and the address of the range of VkDeviceMemory object that is 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

    • If buffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object
Valid Usage (Implicit)

    • 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

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

    • Host access to commandBuffer must be externally synchronized

    • Host access to the VkCommandPool that commandBuffer was allocated from must be externally synchronized
Command Properties
Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type
Primary Secondary | Both | Graphics |

SEE ALSO

VkBuffer, VkCommandBuffer, VkDeviceSize, VkIndexType

DOCUMENT NOTES

For more information, see the Vulkan Specification at URL

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

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.