C Specification

To record an indirect mesh tasks drawing command, call:

// Provided by VK_NV_mesh_shader
void vkCmdDrawMeshTasksIndirectNV(
    VkCommandBuffer                             commandBuffer,
    VkBuffer                                    buffer,
    VkDeviceSize                                offset,
    uint32_t                                    drawCount,
    uint32_t                                    stride);

Parameters

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

  • buffer is the buffer containing draw parameters.

  • offset is the byte offset into buffer where parameters begin.

  • drawCount is the number of draws to execute, and can be zero.

  • stride is the byte stride between successive sets of draw parameters.

Description

vkCmdDrawMeshTasksIndirectNV behaves similarly to vkCmdDrawMeshTasksNV except that the parameters are read by the device from a buffer during execution. drawCount draws are executed by the command, with parameters taken from buffer starting at offset and increasing by stride bytes for each successive draw. The parameters of each draw are encoded in an array of VkDrawMeshTasksIndirectCommandNV structures. If drawCount is less than or equal to one, stride is ignored.

Valid Usage
  • VUID-vkCmdDrawMeshTasksIndirectNV-buffer-02708
    If buffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object

  • VUID-vkCmdDrawMeshTasksIndirectNV-buffer-02709
    buffer must have been created with the VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT usage flag set

  • VUID-vkCmdDrawMeshTasksIndirectNV-offset-02710
    offset must be a multiple of 4

  • VUID-vkCmdDrawMeshTasksIndirectNV-commandBuffer-02711
    commandBuffer must not be a protected command buffer

  • VUID-vkCmdDrawMeshTasksIndirectNV-drawCount-02718
    If the multiDrawIndirect feature is not enabled, drawCount must be 0 or 1

  • VUID-vkCmdDrawMeshTasksIndirectNV-drawCount-02719
    drawCount must be less than or equal to VkPhysicalDeviceLimits::maxDrawIndirectCount

  • VUID-vkCmdDrawMeshTasksIndirectNV-drawCount-02146
    If drawCount is greater than 1, stride must be a multiple of 4 and must be greater than or equal to sizeof(VkDrawMeshTasksIndirectCommandNV)

  • VUID-vkCmdDrawMeshTasksIndirectNV-drawCount-02156
    If drawCount is equal to 1, (offset + sizeof(VkDrawMeshTasksIndirectCommandNV)) must be less than or equal to the size of buffer

  • VUID-vkCmdDrawMeshTasksIndirectNV-drawCount-02157
    If drawCount is greater than 1, (stride × (drawCount - 1) + offset + sizeof(VkDrawMeshTasksIndirectCommandNV)) must be less than or equal to the size of buffer

  • VUID-vkCmdDrawMeshTasksIndirectNV-MeshNV-07081
    The current pipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS must contain a shader stage using the MeshNV Execution Model

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

  • VUID-vkCmdDrawMeshTasksIndirectNV-buffer-parameter
    buffer must be a valid VkBuffer handle

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

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

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

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

  • VUID-vkCmdDrawMeshTasksIndirectNV-videocoding
    This command must only be called outside of a video coding scope

  • VUID-vkCmdDrawMeshTasksIndirectNV-commonparent
    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 Video Coding Scope Supported Queue Types Command Type

Primary
Secondary

Inside

Outside

VK_QUEUE_GRAPHICS_BIT

Action

Conditional Rendering

vkCmdDrawMeshTasksIndirectNV 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