C Specification

To record a non-indexed indirect drawing command, call:

// Provided by VK_KHR_device_address_commands with VK_KHR_draw_indirect_count or VK_VERSION_1_2
void vkCmdDrawIndexedIndirectCount2KHR(
    VkCommandBuffer                             commandBuffer,
    const VkDrawIndirectCount2InfoKHR*          pInfo);

Parameters

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

  • pInfo is a pointer to a VkDrawIndirectCount2InfoKHR structure defining parameters of this command.

Description

vkCmdDrawIndexedIndirectCount2KHR behaves similarly to vkCmdDrawIndexedIndirect2KHR except that the draw count is read by the device from an address range during execution. The command will read an unsigned 32-bit integer from pInfo->countAddressRange and use this as the draw count.

Valid Usage
  • VUID-vkCmdDrawIndexedIndirectCount2KHR-pInfo-13110
    If pInfo->maxDrawCount is greater than 0, pInfo->addressRange.size must be greater than or equal to (pInfo->maxDrawCount - 1) × pInfo->addressRange.stride + sizeof(VkDrawIndexedIndirectCommand)

  • VUID-vkCmdDrawIndexedIndirectCount2KHR-pInfo-13111
    If pInfo->maxDrawCount is greater than 1, pInfo->addressRange.stride must not be 0

  • VUID-vkCmdDrawIndexedIndirectCount2KHR-pInfo-13112
    If pInfo->addressRange.stride is not 0, pInfo->addressRange.stride must be greater than or equal to sizeof(VkDrawIndexedIndirectCommand)

  • VUID-vkCmdDrawIndexedIndirectCount2KHR-pInfo-13113
    If pInfo->addressRange.stride is not 0, pInfo->addressRange.stride must be a multiple of 4

  • VUID-vkCmdDrawIndexedIndirectCount2KHR-None-07312
    If the maintenance6 feature is not enabled, a valid index buffer must be bound

  • VUID-vkCmdDrawIndexedIndirectCount2KHR-primitiveRestartIndex-12401
    If the primitive restart index for this draw operation was set with vkCmdSetPrimitiveRestartIndexEXT, then primitiveRestartIndex must not be greater than the maximum representable value for the bound VkIndexType

  • VUID-vkCmdDrawIndexedIndirectCount2KHR-commandBuffer-13060
    commandBuffer must not be a protected command buffer

  • VUID-vkCmdDrawIndexedIndirectCount2KHR-drawIndirectCount-13120
    If the drawIndirectCount feature is not enabled this function must not be used

Valid Usage (Implicit)
  • VUID-vkCmdDrawIndexedIndirectCount2KHR-commandBuffer-parameter
    commandBuffer must be a valid VkCommandBuffer handle

  • VUID-vkCmdDrawIndexedIndirectCount2KHR-pInfo-parameter
    pInfo must be a valid pointer to a valid VkDrawIndirectCount2InfoKHR structure

  • VUID-vkCmdDrawIndexedIndirectCount2KHR-commandBuffer-recording
    commandBuffer must be in the recording state

  • VUID-vkCmdDrawIndexedIndirectCount2KHR-commandBuffer-cmdpool
    The VkCommandPool that commandBuffer was allocated from must support VK_QUEUE_GRAPHICS_BIT operations

  • VUID-vkCmdDrawIndexedIndirectCount2KHR-renderpass
    This command must only be called inside of a render pass instance

  • VUID-vkCmdDrawIndexedIndirectCount2KHR-suspended
    This command must not be called between suspended render pass instances

  • VUID-vkCmdDrawIndexedIndirectCount2KHR-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

Inside

Outside

VK_QUEUE_GRAPHICS_BIT

Action

Conditional Rendering

vkCmdDrawIndexedIndirectCount2KHR is affected by conditional rendering

See Also

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 2014-2026 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0