vkCmdSetPrimitiveRestartIndexEXT(3)

# vkCmdSetPrimitiveRestartIndexEXT(3) Manual Page

## Name

vkCmdSetPrimitiveRestartIndexEXT - Set primitive assembly restart index dynamically for a command buffer

## C Specification

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

    // Provided by VK_EXT_primitive_restart_index
    void vkCmdSetPrimitiveRestartIndexEXT(
        VkCommandBuffer                             commandBuffer,
        uint32_t                                    primitiveRestartIndex);

## Parameters

- `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 restart index value as defined as part of the description of the VkPipelineInputAssemblyStateCreateInfo::`primitiveRestartEnable` state. Default values are applied when binding an index buffer.

## Description

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

Valid Usage

- VUID-vkCmdSetPrimitiveRestartIndexEXT-primitiveRestartIndex-12395
  The `primitiveRestartIndex` feature must be enabled

Valid Usage (Implicit)

- VUID-vkCmdSetPrimitiveRestartIndexEXT-commandBuffer-parameter
  `commandBuffer` must be a valid VkCommandBuffer handle

- VUID-vkCmdSetPrimitiveRestartIndexEXT-commandBuffer-recording
  `commandBuffer` must be in the recording state

- 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

Command Properties

Command Buffer Levels | Render Pass Scope | Video Coding Scope | Supported Queue Types | Command Type
--- | --- | --- | --- | ---
Primary Secondary | Both | Outside | VK_QUEUE_GRAPHICS_BIT | State

Conditional Rendering

vkCmdSetPrimitiveRestartIndexEXT is not affected by conditional rendering

## See Also

VK_EXT_primitive_restart_index, VkCommandBuffer

## Document Notes

For more information, see the Vulkan Specification.

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

## Copyright

Copyright 2014-2026 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0