| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Graphics.Vulkan.Core12.Promoted_From_VK_KHR_draw_indirect_count
Synopsis
- cmdDrawIndirectCount :: forall io. MonadIO io => CommandBuffer -> Buffer -> ("offset" ::: DeviceSize) -> ("countBuffer" ::: Buffer) -> ("countBufferOffset" ::: DeviceSize) -> ("maxDrawCount" ::: Word32) -> ("stride" ::: Word32) -> io ()
- cmdDrawIndexedIndirectCount :: forall io. MonadIO io => CommandBuffer -> Buffer -> ("offset" ::: DeviceSize) -> ("countBuffer" ::: Buffer) -> ("countBufferOffset" ::: DeviceSize) -> ("maxDrawCount" ::: Word32) -> ("stride" ::: Word32) -> io ()
Documentation
cmdDrawIndirectCount :: forall io. MonadIO io => CommandBuffer -> Buffer -> ("offset" ::: DeviceSize) -> ("countBuffer" ::: Buffer) -> ("countBufferOffset" ::: DeviceSize) -> ("maxDrawCount" ::: Word32) -> ("stride" ::: Word32) -> io () Source #
vkCmdDrawIndirectCount - Perform an indirect draw with the draw count sourced from a buffer
Parameters
commandBufferis the command buffer into which the command is recorded.
bufferis the buffer containing draw parameters.offsetis the byte offset intobufferwhere parameters begin.countBufferis the buffer containing the draw count.countBufferOffsetis the byte offset intocountBufferwhere the draw count begins.maxDrawCountspecifies the maximum number of draws that will be executed. The actual number of executed draw calls is the minimum of the count specified incountBufferandmaxDrawCount.strideis the byte stride between successive sets of draw parameters.
Description
cmdDrawIndirectCount behaves similarly to
cmdDrawIndirect except
that the draw count is read by the device from a buffer during
execution. The command will read an unsigned 32-bit integer from
countBuffer located at countBufferOffset and use this as the draw
count.
Valid Usage
- If a
ImageViewis sampled withFILTER_LINEARas a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
- If a
ImageViewis accessed using atomic operations as a result of this command, then the image view’s format features must containFORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT - If a
ImageViewis sampled withFILTER_CUBIC_EXTas a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT - Any
ImageViewbeing sampled withFILTER_CUBIC_EXTas a result of this command must have aImageViewTypeand format that supports cubic filtering, as specified byFilterCubicImageViewImageFormatPropertiesEXT::filterCubicreturned bygetPhysicalDeviceImageFormatProperties2 - Any
ImageViewbeing sampled withFILTER_CUBIC_EXTwith a reduction mode of eitherSAMPLER_REDUCTION_MODE_MINorSAMPLER_REDUCTION_MODE_MAXas a result of this command must have aImageViewTypeand format that supports cubic filtering together with minmax filtering, as specified byFilterCubicImageViewImageFormatPropertiesEXT::filterCubicMinmaxreturned bygetPhysicalDeviceImageFormatProperties2 - Any
Imagecreated with aImageCreateInfo::flagscontainingIMAGE_CREATE_CORNER_SAMPLED_BIT_NVsampled as a result of this command must only be sampled using aSamplerAddressModeofSAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE. - For each set n that is statically used by the
Pipelinebound to the pipeline bind point used by this command, a descriptor set must have been bound to n at the same pipeline bind point, with aPipelineLayoutthat is compatible for set n, with thePipelineLayoutused to create the currentPipeline, as described in ??? - For each push constant that is statically used by the
Pipelinebound to the pipeline bind point used by this command, a push constant value must have been set for the same pipeline bind point, with aPipelineLayoutthat is compatible for push constants, with thePipelineLayoutused to create the currentPipeline, as described in ??? - Descriptors in each bound descriptor set, specified via
cmdBindDescriptorSets, must be valid if they are statically used by thePipelinebound to the pipeline bind point used by this command - A valid pipeline must be bound to the pipeline bind point used by this command
- If the
Pipelineobject bound to the pipeline bind point used by this command requires any dynamic state, that state must have been set forcommandBuffer, and done so after any previously bound pipeline with the corresponding state not specified as dynamic - There must not have been any calls to dynamic state setting
commands for any state not specified as dynamic in the
Pipelineobject bound to the pipeline bind point used by this command, since that pipeline was bound - If the
Pipelineobject bound to the pipeline bind point used by this command accesses aSamplerobject that uses unnormalized coordinates, that sampler must not be used to sample from anyImagewith aImageViewof the typeIMAGE_VIEW_TYPE_3D,IMAGE_VIEW_TYPE_CUBE,IMAGE_VIEW_TYPE_1D_ARRAY,IMAGE_VIEW_TYPE_2D_ARRAYorIMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage - If the
Pipelineobject bound to the pipeline bind point used by this command accesses aSamplerobject that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*orOpImageSparseSample*instructions withImplicitLod,DreforProjin their name, in any shader stage - If the
Pipelineobject bound to the pipeline bind point used by this command accesses aSamplerobject that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*orOpImageSparseSample*instructions that includes a LOD bias or any offset values, in any shader stage - If the
robust buffer access
feature is not enabled, and if the
Pipelineobject bound to the pipeline bind point used by this command accesses a uniform buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point - If the
robust buffer access
feature is not enabled, and if the
Pipelineobject bound to the pipeline bind point used by this command accesses a storage buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point - If
commandBufferis an unprotected command buffer, any resource accessed by thePipelineobject bound to the pipeline bind point used by this command must not be a protected resource - The current render pass must be
compatible
with the
renderPassmember of theGraphicsPipelineCreateInfostructure specified when creating thePipelinebound toPIPELINE_BIND_POINT_GRAPHICS. - The subpass index of the current render pass must be equal to the
subpassmember of theGraphicsPipelineCreateInfostructure specified when creating thePipelinebound toPIPELINE_BIND_POINT_GRAPHICS. - Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set
- Image subresources used as attachments in the current render pass must not be accessed in any way other than as an attachment by this command.
- If the draw is recorded in a render pass instance with multiview
enabled, the maximum instance index must be less than or equal to
PhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex. - If the bound graphics pipeline was created with
PipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnableset toTRUEand the current subpass has a depth/stencil attachment, then that attachment must have been created with theIMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXTbit set - All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point’s interface must have valid buffers bound
- For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in ???
- If
bufferis non-sparse then it must be bound completely and contiguously to a singleDeviceMemoryobject buffermust have been created with theBUFFER_USAGE_INDIRECT_BUFFER_BITbit setoffsetmust be a multiple of4commandBuffermust not be a protected command buffer- If
countBufferis non-sparse then it must be bound completely and contiguously to a singleDeviceMemoryobject countBuffermust have been created with theBUFFER_USAGE_INDIRECT_BUFFER_BITbit setcountBufferOffsetmust be a multiple of4- The count stored in
countBuffermust be less than or equal toPhysicalDeviceLimits::maxDrawIndirectCount stridemust be a multiple of4and must be greater than or equal to sizeof(DrawIndirectCommand)- If
maxDrawCountis greater than or equal to1, (stride× (maxDrawCount- 1) +offset+ sizeof(DrawIndirectCommand)) must be less than or equal to the size ofbuffer - If the count stored in
countBufferis equal to1, (offset+ sizeof(DrawIndirectCommand)) must be less than or equal to the size ofbuffer - If the count stored in
countBufferis greater than1, (stride× (drawCount- 1) +offset+ sizeof(DrawIndirectCommand)) must be less than or equal to the size ofbuffer - If drawIndirectCount is not enabled this function must not be used
Valid Usage (Implicit)
commandBuffermust be a validCommandBufferhandle
buffermust be a validBufferhandlecountBuffermust be a validBufferhandlecommandBuffermust be in the recording state- The
CommandPoolthatcommandBufferwas allocated from must support graphics operations - This command must only be called inside of a render pass instance
- Each of
buffer,commandBuffer, andcountBuffermust have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to
commandBuffermust be externally synchronized
- Host access to the
CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type |
|---|---|---|---|
| Primary Secondary | Inside | Graphics | Graphics |
See Also
cmdDrawIndexedIndirectCount :: forall io. MonadIO io => CommandBuffer -> Buffer -> ("offset" ::: DeviceSize) -> ("countBuffer" ::: Buffer) -> ("countBufferOffset" ::: DeviceSize) -> ("maxDrawCount" ::: Word32) -> ("stride" ::: Word32) -> io () Source #
vkCmdDrawIndexedIndirectCount - Perform an indexed indirect draw with the draw count sourced from a buffer
Parameters
commandBufferis the command buffer into which the command is recorded.
bufferis the buffer containing draw parameters.offsetis the byte offset intobufferwhere parameters begin.countBufferis the buffer containing the draw count.countBufferOffsetis the byte offset intocountBufferwhere the draw count begins.maxDrawCountspecifies the maximum number of draws that will be executed. The actual number of executed draw calls is the minimum of the count specified incountBufferandmaxDrawCount.strideis the byte stride between successive sets of draw parameters.
Description
cmdDrawIndexedIndirectCount behaves similarly to
cmdDrawIndexedIndirect
except that the draw count is read by the device from a buffer during
execution. The command will read an unsigned 32-bit integer from
countBuffer located at countBufferOffset and use this as the draw
count.
Valid Usage
- If a
ImageViewis sampled withFILTER_LINEARas a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
- If a
ImageViewis accessed using atomic operations as a result of this command, then the image view’s format features must containFORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT - If a
ImageViewis sampled withFILTER_CUBIC_EXTas a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT - Any
ImageViewbeing sampled withFILTER_CUBIC_EXTas a result of this command must have aImageViewTypeand format that supports cubic filtering, as specified byFilterCubicImageViewImageFormatPropertiesEXT::filterCubicreturned bygetPhysicalDeviceImageFormatProperties2 - Any
ImageViewbeing sampled withFILTER_CUBIC_EXTwith a reduction mode of eitherSAMPLER_REDUCTION_MODE_MINorSAMPLER_REDUCTION_MODE_MAXas a result of this command must have aImageViewTypeand format that supports cubic filtering together with minmax filtering, as specified byFilterCubicImageViewImageFormatPropertiesEXT::filterCubicMinmaxreturned bygetPhysicalDeviceImageFormatProperties2 - Any
Imagecreated with aImageCreateInfo::flagscontainingIMAGE_CREATE_CORNER_SAMPLED_BIT_NVsampled as a result of this command must only be sampled using aSamplerAddressModeofSAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE. - For each set n that is statically used by the
Pipelinebound to the pipeline bind point used by this command, a descriptor set must have been bound to n at the same pipeline bind point, with aPipelineLayoutthat is compatible for set n, with thePipelineLayoutused to create the currentPipeline, as described in ??? - For each push constant that is statically used by the
Pipelinebound to the pipeline bind point used by this command, a push constant value must have been set for the same pipeline bind point, with aPipelineLayoutthat is compatible for push constants, with thePipelineLayoutused to create the currentPipeline, as described in ??? - Descriptors in each bound descriptor set, specified via
cmdBindDescriptorSets, must be valid if they are statically used by thePipelinebound to the pipeline bind point used by this command - A valid pipeline must be bound to the pipeline bind point used by this command
- If the
Pipelineobject bound to the pipeline bind point used by this command requires any dynamic state, that state must have been set forcommandBuffer, and done so after any previously bound pipeline with the corresponding state not specified as dynamic - There must not have been any calls to dynamic state setting
commands for any state not specified as dynamic in the
Pipelineobject bound to the pipeline bind point used by this command, since that pipeline was bound - If the
Pipelineobject bound to the pipeline bind point used by this command accesses aSamplerobject that uses unnormalized coordinates, that sampler must not be used to sample from anyImagewith aImageViewof the typeIMAGE_VIEW_TYPE_3D,IMAGE_VIEW_TYPE_CUBE,IMAGE_VIEW_TYPE_1D_ARRAY,IMAGE_VIEW_TYPE_2D_ARRAYorIMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage - If the
Pipelineobject bound to the pipeline bind point used by this command accesses aSamplerobject that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*orOpImageSparseSample*instructions withImplicitLod,DreforProjin their name, in any shader stage - If the
Pipelineobject bound to the pipeline bind point used by this command accesses aSamplerobject that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*orOpImageSparseSample*instructions that includes a LOD bias or any offset values, in any shader stage - If the
robust buffer access
feature is not enabled, and if the
Pipelineobject bound to the pipeline bind point used by this command accesses a uniform buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point - If the
robust buffer access
feature is not enabled, and if the
Pipelineobject bound to the pipeline bind point used by this command accesses a storage buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point - If
commandBufferis an unprotected command buffer, any resource accessed by thePipelineobject bound to the pipeline bind point used by this command must not be a protected resource - The current render pass must be
compatible
with the
renderPassmember of theGraphicsPipelineCreateInfostructure specified when creating thePipelinebound toPIPELINE_BIND_POINT_GRAPHICS. - The subpass index of the current render pass must be equal to the
subpassmember of theGraphicsPipelineCreateInfostructure specified when creating thePipelinebound toPIPELINE_BIND_POINT_GRAPHICS. - Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set
- Image subresources used as attachments in the current render pass must not be accessed in any way other than as an attachment by this command.
- If the draw is recorded in a render pass instance with multiview
enabled, the maximum instance index must be less than or equal to
PhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex. - If the bound graphics pipeline was created with
PipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnableset toTRUEand the current subpass has a depth/stencil attachment, then that attachment must have been created with theIMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXTbit set - All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point’s interface must have valid buffers bound
- For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in ???
- If
bufferis non-sparse then it must be bound completely and contiguously to a singleDeviceMemoryobject buffermust have been created with theBUFFER_USAGE_INDIRECT_BUFFER_BITbit setoffsetmust be a multiple of4commandBuffermust not be a protected command buffer- If
countBufferis non-sparse then it must be bound completely and contiguously to a singleDeviceMemoryobject countBuffermust have been created with theBUFFER_USAGE_INDIRECT_BUFFER_BITbit setcountBufferOffsetmust be a multiple of4- The count stored in
countBuffermust be less than or equal toPhysicalDeviceLimits::maxDrawIndirectCount stridemust be a multiple of4and must be greater than or equal to sizeof(DrawIndexedIndirectCommand)- If
maxDrawCountis greater than or equal to1, (stride× (maxDrawCount- 1) +offset+ sizeof(DrawIndexedIndirectCommand)) must be less than or equal to the size ofbuffer - If count stored in
countBufferis equal to1, (offset+ sizeof(DrawIndexedIndirectCommand)) must be less than or equal to the size ofbuffer - If count stored in
countBufferis greater than1, (stride× (drawCount- 1) +offset+ sizeof(DrawIndexedIndirectCommand)) must be less than or equal to the size ofbuffer
Valid Usage (Implicit)
commandBuffermust be a validCommandBufferhandle
buffermust be a validBufferhandlecountBuffermust be a validBufferhandlecommandBuffermust be in the recording state- The
CommandPoolthatcommandBufferwas allocated from must support graphics operations - This command must only be called inside of a render pass instance
- Each of
buffer,commandBuffer, andcountBuffermust have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to
commandBuffermust be externally synchronized
- Host access to the
CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type |
|---|---|---|---|
| Primary Secondary | Inside | Graphics | Graphics |