Movatterモバイル変換


[0]ホーム

URL:


Vulkan API Reference Pageslatest

vkCmdDrawIndirectCount(3)

Name

vkCmdDrawIndirectCount - Draw primitives with indirect parameters and draw count

C Specification

To record a non-indexed draw call with a draw call count sourced from abuffer, call:

// Provided by VK_VERSION_1_2void vkCmdDrawIndirectCount(    VkCommandBuffer                             commandBuffer,    VkBuffer                                    buffer,    VkDeviceSize                                offset,    VkBuffer                                    countBuffer,    VkDeviceSize                                countBufferOffset,    uint32_t                                    maxDrawCount,    uint32_t                                    stride);
// Provided by VK_KHR_draw_indirect_count// Equivalent to vkCmdDrawIndirectCountvoid vkCmdDrawIndirectCountKHR(    VkCommandBuffer                             commandBuffer,    VkBuffer                                    buffer,    VkDeviceSize                                offset,    VkBuffer                                    countBuffer,    VkDeviceSize                                countBufferOffset,    uint32_t                                    maxDrawCount,    uint32_t                                    stride);
// Provided by VK_AMD_draw_indirect_count// Equivalent to vkCmdDrawIndirectCountvoid vkCmdDrawIndirectCountAMD(    VkCommandBuffer                             commandBuffer,    VkBuffer                                    buffer,    VkDeviceSize                                offset,    VkBuffer                                    countBuffer,    VkDeviceSize                                countBufferOffset,    uint32_t                                    maxDrawCount,    uint32_t                                    stride);

Parameters

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

  • buffer is the buffer containing draw parameters.

  • offset is the byte offset intobuffer where parametersbegin.

  • countBuffer is the buffer containing the draw count.

  • countBufferOffset is the byte offset intocountBuffer wherethe draw count begins.

  • maxDrawCount specifies the maximum number of draws that will beexecuted.The actual number of executed draw calls is the minimum of the countspecified incountBuffer andmaxDrawCount.

  • stride is the byte stride between successive sets of drawparameters.

Description

vkCmdDrawIndirectCount behaves similarly tovkCmdDrawIndirectexcept that the draw count is read by the device from a buffer duringexecution.The command will read an unsigned 32-bit integer fromcountBufferlocated atcountBufferOffset and use this as the draw count.

Valid Usage
  • VUID-vkCmdDrawIndirectCount-buffer-02708
    Ifbuffer is non-sparse then itmust be bound completely andcontiguously to a singleVkDeviceMemory object

  • VUID-vkCmdDrawIndirectCount-buffer-02709
    buffermust have been created with theVK_BUFFER_USAGE_INDIRECT_BUFFER_BIT usage flag set

  • VUID-vkCmdDrawIndirectCount-offset-02710
    offsetmust be a multiple of4

  • VUID-vkCmdDrawIndirectCount-commandBuffer-02711
    commandBuffermust not be a protected command buffer

  • VUID-vkCmdDrawIndirectCount-countBuffer-02714
    IfcountBuffer is non-sparse then itmust be bound completely andcontiguously to a singleVkDeviceMemory object

  • VUID-vkCmdDrawIndirectCount-countBuffer-02715
    countBuffermust have been created with theVK_BUFFER_USAGE_INDIRECT_BUFFER_BIT usage flag set

  • VUID-vkCmdDrawIndirectCount-countBufferOffset-02716
    countBufferOffsetmust be a multiple of4

  • VUID-vkCmdDrawIndirectCount-countBuffer-02717
    The count stored incountBuffermust be less than or equal toVkPhysicalDeviceLimits::maxDrawIndirectCount

  • VUID-vkCmdDrawIndirectCount-countBufferOffset-04129
    (countBufferOffset +sizeof(uint32_t))must beless than or equal to the size ofcountBuffer

  • VUID-vkCmdDrawIndirectCount-None-04445
    If thedrawIndirectCount featureis not enabled this functionmust not be used

  • VUID-vkCmdDrawIndirectCount-stride-03110
    stridemust be a multiple of4 andmust be greater than orequal to sizeof(VkDrawIndirectCommand)

  • VUID-vkCmdDrawIndirectCount-maxDrawCount-03111
    IfmaxDrawCount is greater than or equal to1,(stride × (maxDrawCount - 1) +offset+ sizeof(VkDrawIndirectCommand))must be less than or equalto the size ofbuffer

Valid Usage (Implicit)
  • VUID-vkCmdDrawIndirectCount-commandBuffer-parameter
    commandBuffermust be a validVkCommandBuffer handle

  • VUID-vkCmdDrawIndirectCount-buffer-parameter
    buffermust be a validVkBuffer handle

  • VUID-vkCmdDrawIndirectCount-countBuffer-parameter
    countBuffermust be a validVkBuffer handle

  • VUID-vkCmdDrawIndirectCount-commandBuffer-recording
    commandBuffermust be in therecording state

  • VUID-vkCmdDrawIndirectCount-commandBuffer-cmdpool
    TheVkCommandPool thatcommandBuffer was allocated frommust supportVK_QUEUE_GRAPHICS_BIT operations

  • VUID-vkCmdDrawIndirectCount-renderpass
    This commandmust only be called inside of a render pass instance

  • VUID-vkCmdDrawIndirectCount-suspended
    This commandmust not be called between suspended render pass instances

  • VUID-vkCmdDrawIndirectCount-videocoding
    This commandmust only be called outside of a video coding scope

  • VUID-vkCmdDrawIndirectCount-commonparent
    Each ofbuffer,commandBuffer, andcountBuffermust have been created, allocated, or retrieved from the sameVkDevice

Host Synchronization
  • Host access tocommandBuffermust be externally synchronized

  • Host access to theVkCommandPool thatcommandBuffer was allocated frommust be externally synchronized

Command Properties
Command Buffer LevelsRender Pass ScopeVideo Coding ScopeSupported Queue TypesCommand Type

Primary
Secondary

Inside

Outside

VK_QUEUE_GRAPHICS_BIT

Action

Conditional Rendering

vkCmdDrawIndirectCount is affected byconditional rendering

See Also

Document Notes

For more information, see theVulkan Specification.

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


[8]ページ先頭

©2009-2026 Movatter.jp