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 is a VkIndexType value specifying whether indices are treated as 16 bits or 32 bits.

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

Document Notes

For more information, see the Vulkan Specification at URL

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

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