Function Prototype

vkCmdSetPrimitiveRestartIndexEXT

Set primitive assembly restart index dynamically for a command buffer

To dynamically control which special vertex index value is treated as restarting the assembly of primitives, call:

void vkCmdSetPrimitiveRestartIndexEXT(
    VkCommandBuffer commandBuffer,
    uint32_t primitiveRestartIndex);
  • commandBuffer is the command buffer into which the command will be recorded.
  • primitiveRestartIndex controls which special vertex index value is treated as restarting the assembly of primitives. This overrides the default values specified in VkPipelineInputAssemblyStateCreateInfo::primitiveRestartEnable.

This command sets a custom primitive restart index for subsequent drawing commands. Binding an index buffer invalidates the custom index value.

Valid Usage (Implicit)

VUID-vkCmdSetPrimitiveRestartIndexEXT-commandBuffer-cmdpool

The VkCommandPool that commandBuffer was allocated from must support VK_QUEUE_GRAPHICS_BIT operations

VUID-vkCmdSetPrimitiveRestartIndexEXT-videocoding

This command must only be called outside of a video coding scope

Host Synchronization

  • Host access to commandBuffer must be externally synchronized
  • Host access to the VkCommandPool that commandBuffer was allocated from must be externally synchronized