| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Graphics.Vulkan.Extensions.VK_AMD_draw_indirect_count
- pattern VK_AMD_DRAW_INDIRECT_COUNT_SPEC_VERSION :: Integral a => a
- pattern VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME :: (Eq a, IsString a) => a
- vkCmdDrawIndirectCountAMD :: ("commandBuffer" ::: VkCommandBuffer) -> ("buffer" ::: VkBuffer) -> ("offset" ::: VkDeviceSize) -> ("countBuffer" ::: VkBuffer) -> ("countBufferOffset" ::: VkDeviceSize) -> ("maxDrawCount" ::: Word32) -> ("stride" ::: Word32) -> IO ()
- vkCmdDrawIndexedIndirectCountAMD :: ("commandBuffer" ::: VkCommandBuffer) -> ("buffer" ::: VkBuffer) -> ("offset" ::: VkDeviceSize) -> ("countBuffer" ::: VkBuffer) -> ("countBufferOffset" ::: VkDeviceSize) -> ("maxDrawCount" ::: Word32) -> ("stride" ::: Word32) -> IO ()
Documentation
pattern VK_AMD_DRAW_INDIRECT_COUNT_SPEC_VERSION :: Integral a => a Source #
pattern VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME :: (Eq a, IsString a) => a Source #
vkCmdDrawIndirectCountAMD :: ("commandBuffer" ::: VkCommandBuffer) -> ("buffer" ::: VkBuffer) -> ("offset" ::: VkDeviceSize) -> ("countBuffer" ::: VkBuffer) -> ("countBufferOffset" ::: VkDeviceSize) -> ("maxDrawCount" ::: Word32) -> ("stride" ::: Word32) -> IO () Source #
vkCmdDrawIndirectCountAMD - 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
vkCmdDrawIndirectCountAMD behaves similarly to
vkCmdDrawIndirect 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
bufferis non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemoryobject
buffermust have been created with theVK_BUFFER_USAGE_INDIRECT_BUFFER_BITbit set- If
countBufferis non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemoryobject countBuffermust have been created with theVK_BUFFER_USAGE_INDIRECT_BUFFER_BITbit setoffsetmust be a multiple of4countBufferOffsetmust be a multiple of4stridemust be a multiple of4and must be greater than or equal tosizeof(VkDrawIndirectCommand)- If
maxDrawCountis greater than or equal to1, (stride× (maxDrawCount- 1) +offset+sizeof(VkDrawIndirectCommand)) must be less than or equal to the size ofbuffer - If the
drawIndirectFirstInstance
feature is not enabled, all the
firstInstancemembers of theVkDrawIndirectCommandstructures accessed by this command must be0 - The current render pass must be
compatible with the
renderPassmember of theVkGraphicsPipelineCreateInfostructure specified when creating theVkPipelinebound toVK_PIPELINE_BIND_POINT_GRAPHICS. - The subpass index of the current render pass must be equal to the
subpassmember of theVkGraphicsPipelineCreateInfostructure specified when creating theVkPipelinebound toVK_PIPELINE_BIND_POINT_GRAPHICS. - For each set n that is statically used by the
VkPipelinebound toVK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n atVK_PIPELINE_BIND_POINT_GRAPHICS, with aVkPipelineLayoutthat is compatible for set n, with theVkPipelineLayoutused to create the currentVkPipeline, as described in {html_spec_relative}#descriptorsets-compatibility - For each push constant that is statically used by the
VkPipelinebound toVK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set forVK_PIPELINE_BIND_POINT_GRAPHICS, with aVkPipelineLayoutthat is compatible for push constants, with theVkPipelineLayoutused to create the currentVkPipeline, as described in {html_spec_relative}#descriptorsets-compatibility - Descriptors in each bound descriptor set, specified via
vkCmdBindDescriptorSets, must be valid if they are statically used by the boundVkPipelineobject, specified viavkCmdBindPipeline - All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point’s interface must have valid buffers bound
- A valid graphics pipeline must be bound to the current command
buffer with
VK_PIPELINE_BIND_POINT_GRAPHICS - If the
VkPipelineobject bound toVK_PIPELINE_BIND_POINT_GRAPHICSrequires any dynamic state, that state must have been set on the current command buffer - If the count stored in
countBufferis equal to1, (offset+sizeof(VkDrawIndirectCommand)) must be less than or equal to the size ofbuffer - If the count stored in
countBufferis greater than1, (stride× (drawCount- 1) +offset+sizeof(VkDrawIndirectCommand)) must be less than or equal to the size ofbuffer - The count stored in
countBuffermust be less than or equal toVkPhysicalDeviceLimits::maxDrawIndirectCount - Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set
- If any
VkSamplerobject that is accessed from a shader by theVkPipelinebound toVK_PIPELINE_BIND_POINT_GRAPHICSuses unnormalized coordinates, it must not be used to sample from anyVkImagewith aVkImageViewof the typeVK_IMAGE_VIEW_TYPE_3D,VK_IMAGE_VIEW_TYPE_CUBE,VK_IMAGE_VIEW_TYPE_1D_ARRAY,VK_IMAGE_VIEW_TYPE_2D_ARRAYorVK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage - If any
VkSamplerobject that is accessed from a shader by theVkPipelinebound toVK_PIPELINE_BIND_POINT_GRAPHICSuses unnormalized coordinates, it must not be used with any of the SPIR-VOpImageSample*orOpImageSparseSample*instructions withImplicitLod,DreforProjin their name, in any shader stage - If any
VkSamplerobject that is accessed from a shader by theVkPipelinebound toVK_PIPELINE_BIND_POINT_GRAPHICSuses unnormalized coordinates, it 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 any shader stage in the
VkPipelineobject bound toVK_PIPELINE_BIND_POINT_GRAPHICSaccesses a uniform buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set - If the
robust buffer access
feature is not enabled, and any shader stage in the
VkPipelineobject bound toVK_PIPELINE_BIND_POINT_GRAPHICSaccesses a storage buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set - Any
VkImageViewbeing sampled withVK_FILTER_LINEARas a result of this command must be of a format which supports linear filtering, as specified by theVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BITflag inVkFormatProperties::linearTilingFeatures(for a linear image) orVkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned byvkGetPhysicalDeviceFormatProperties - 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
VkPhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex. - If the bound graphics pipeline was created with
VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnableset toVK_TRUEand the current subpass has a depth/stencil attachment, then that attachment must have been created with theVK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXTbit set
Valid Usage (Implicit)
commandBuffermust be a validVkCommandBufferhandle
buffermust be a validVkBufferhandlecountBuffermust be a validVkBufferhandlecommandBuffermust be in the recording state- The
VkCommandPoolthatcommandBufferwas 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 sameVkDevice
Host Synchronization
- Host access to
commandBuffermust be externally synchronized
- Host access to the
VkCommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
+-----------------+-----------------+-----------------+-----------------+ | <#VkCommandBuff | <#vkCmdBeginRen | <#VkQueueFlagBi | <#synchronizati | | erLevel Command | derPass Render | ts Supported Qu | on-pipeline-sta | | Buffer Levels> | Pass Scope> | eue Types> | ges-types Pipel | | | | | ine Type> | +=================+=================+=================+=================+ | Primary | Inside | Graphics | Graphics | | Secondary | | | | +-----------------+-----------------+-----------------+-----------------+
See Also
VkBuffer,
VkCommandBuffer, VkDeviceSize
vkCmdDrawIndexedIndirectCountAMD :: ("commandBuffer" ::: VkCommandBuffer) -> ("buffer" ::: VkBuffer) -> ("offset" ::: VkDeviceSize) -> ("countBuffer" ::: VkBuffer) -> ("countBufferOffset" ::: VkDeviceSize) -> ("maxDrawCount" ::: Word32) -> ("stride" ::: Word32) -> IO () Source #
vkCmdDrawIndexedIndirectCountAMD - 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
vkCmdDrawIndexedIndirectCountAMD behaves similarly to
vkCmdDrawIndexedIndirect
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
bufferis non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemoryobject
buffermust have been created with theVK_BUFFER_USAGE_INDIRECT_BUFFER_BITbit set- If
countBufferis non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemoryobject countBuffermust have been created with theVK_BUFFER_USAGE_INDIRECT_BUFFER_BITbit setoffsetmust be a multiple of4countBufferOffsetmust be a multiple of4stridemust be a multiple of4and must be greater than or equal tosizeof(VkDrawIndirectCommand)- If
maxDrawCountis greater than or equal to1, (stride× (maxDrawCount- 1) +offset+sizeof(VkDrawIndirectCommand)) must be less than or equal to the size ofbuffer - If the
drawIndirectFirstInstance
feature is not enabled, all the
firstInstancemembers of theVkDrawIndexedIndirectCommandstructures accessed by this command must be0 - The current render pass must be
compatible with the
renderPassmember of theVkGraphicsPipelineCreateInfostructure specified when creating theVkPipelinebound toVK_PIPELINE_BIND_POINT_GRAPHICS. - The subpass index of the current render pass must be equal to the
subpassmember of theVkGraphicsPipelineCreateInfostructure specified when creating theVkPipelinebound toVK_PIPELINE_BIND_POINT_GRAPHICS. - For each set n that is statically used by the
VkPipelinebound toVK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must have been bound to n atVK_PIPELINE_BIND_POINT_GRAPHICS, with aVkPipelineLayoutthat is compatible for set n, with theVkPipelineLayoutused to create the currentVkPipeline, as described in {html_spec_relative}#descriptorsets-compatibility - For each push constant that is statically used by the
VkPipelinebound toVK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must have been set forVK_PIPELINE_BIND_POINT_GRAPHICS, with aVkPipelineLayoutthat is compatible for push constants, with theVkPipelineLayoutused to create the currentVkPipeline, as described in {html_spec_relative}#descriptorsets-compatibility - Descriptors in each bound descriptor set, specified via
vkCmdBindDescriptorSets, must be valid if they are statically used by the boundVkPipelineobject, specified viavkCmdBindPipeline - All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point’s interface must have valid buffers bound
- A valid graphics pipeline must be bound to the current command
buffer with
VK_PIPELINE_BIND_POINT_GRAPHICS - If the
VkPipelineobject bound toVK_PIPELINE_BIND_POINT_GRAPHICSrequires any dynamic state, that state must have been set on the current command buffer - If count stored in
countBufferis equal to1, (offset+sizeof(VkDrawIndexedIndirectCommand)) must be less than or equal to the size ofbuffer - If count stored in
countBufferis greater than1, (stride× (drawCount- 1) +offset+sizeof(VkDrawIndexedIndirectCommand)) must be less than or equal to the size ofbuffer drawCountmust be less than or equal toVkPhysicalDeviceLimits::maxDrawIndirectCount- Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set
- If any
VkSamplerobject that is accessed from a shader by theVkPipelinebound toVK_PIPELINE_BIND_POINT_GRAPHICSuses unnormalized coordinates, it must not be used to sample from anyVkImagewith aVkImageViewof the typeVK_IMAGE_VIEW_TYPE_3D,VK_IMAGE_VIEW_TYPE_CUBE,VK_IMAGE_VIEW_TYPE_1D_ARRAY,VK_IMAGE_VIEW_TYPE_2D_ARRAYorVK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage - If any
VkSamplerobject that is accessed from a shader by theVkPipelinebound toVK_PIPELINE_BIND_POINT_GRAPHICSuses unnormalized coordinates, it must not be used with any of the SPIR-VOpImageSample*orOpImageSparseSample*instructions withImplicitLod,DreforProjin their name, in any shader stage - If any
VkSamplerobject that is accessed from a shader by theVkPipelinebound toVK_PIPELINE_BIND_POINT_GRAPHICSuses unnormalized coordinates, it 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 any shader stage in the
VkPipelineobject bound toVK_PIPELINE_BIND_POINT_GRAPHICSaccesses a uniform buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set - If the
robust buffer access
feature is not enabled, and any shader stage in the
VkPipelineobject bound toVK_PIPELINE_BIND_POINT_GRAPHICSaccesses a storage buffer, it must not access values outside of the range of that buffer specified in the bound descriptor set - Any
VkImageViewbeing sampled withVK_FILTER_LINEARas a result of this command must be of a format which supports linear filtering, as specified by theVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BITflag inVkFormatProperties::linearTilingFeatures(for a linear image) orVkFormatProperties::optimalTilingFeatures(for an optimally tiled image) returned byvkGetPhysicalDeviceFormatProperties - 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
VkPhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex. - If the bound graphics pipeline was created with
VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnableset toVK_TRUEand the current subpass has a depth/stencil attachment, then that attachment must have been created with theVK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXTbit set
Valid Usage (Implicit)
commandBuffermust be a validVkCommandBufferhandle
buffermust be a validVkBufferhandlecountBuffermust be a validVkBufferhandlecommandBuffermust be in the recording state- The
VkCommandPoolthatcommandBufferwas 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 sameVkDevice
Host Synchronization
- Host access to
commandBuffermust be externally synchronized
- Host access to the
VkCommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
+-----------------+-----------------+-----------------+-----------------+ | <#VkCommandBuff | <#vkCmdBeginRen | <#VkQueueFlagBi | <#synchronizati | | erLevel Command | derPass Render | ts Supported Qu | on-pipeline-sta | | Buffer Levels> | Pass Scope> | eue Types> | ges-types Pipel | | | | | ine Type> | +=================+=================+=================+=================+ | Primary | Inside | Graphics | Graphics | | Secondary | | | | +-----------------+-----------------+-----------------+-----------------+
See Also
VkBuffer,
VkCommandBuffer, VkDeviceSize