C Specification
To record a draw that uses the mesh pipeline, call:
void vkCmdDrawMeshTasksNV(
VkCommandBuffer commandBuffer,
uint32_t taskCount,
uint32_t firstTask);
Parameters
-
commandBufferis the command buffer into which the command will be recorded. -
taskCountis the number of local workgroups to dispatch in the X dimension. Y and Z dimension are implicitly set to one. -
firstTaskis the X component of the first workgroup ID.
Description
When the command is executed, a global workgroup consisting of
taskCount local workgroups is assembled.
-
If a
VkImageViewis sampled withVK_FILTER_LINEARas a result of this command, then the image view’s format features must containVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT -
If a
VkImageViewis accessed using atomic operations as a result of this command, then the image view’s format features must containVK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT -
If a
VkImageViewis sampled withVK_FILTER_CUBIC_EXTas a result of this command, then the image view’s format features must containVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT -
Any VkImageView being sampled with
VK_FILTER_CUBIC_EXTas a result of this command must have a VkImageViewType and format that supports cubic filtering, as specified byVkFilterCubicImageViewImageFormatPropertiesEXT::filterCubicreturned byvkGetPhysicalDeviceImageFormatProperties2 -
Any VkImageView being sampled with
VK_FILTER_CUBIC_EXTwith a reduction mode of eitherVK_SAMPLER_REDUCTION_MODE_MINorVK_SAMPLER_REDUCTION_MODE_MAXas a result of this command must have a VkImageViewType and format that supports cubic filtering together with minmax filtering, as specified byVkFilterCubicImageViewImageFormatPropertiesEXT::filterCubicMinmaxreturned byvkGetPhysicalDeviceImageFormatProperties2 -
Any VkImage created with a VkImageCreateInfo::
flagscontainingVK_IMAGE_CREATE_CORNER_SAMPLED_BIT_NVsampled as a result of this command must only be sampled using a VkSamplerAddressMode ofVK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE. -
For each set n that is statically used by the
VkPipelinebound 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 aVkPipelineLayoutthat is compatible for set n, with theVkPipelineLayoutused to create the currentVkPipeline, as described in [descriptorsets-compatibility] -
For each push constant that is statically used by the
VkPipelinebound to the pipeline bind point used by this command, a push constant value must have been set for the same pipeline bind point, with aVkPipelineLayoutthat is compatible for push constants, with theVkPipelineLayoutused to create the currentVkPipeline, as described in [descriptorsets-compatibility] -
Descriptors in each bound descriptor set, specified via
vkCmdBindDescriptorSets, must be valid if they are statically used by theVkPipelinebound 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
VkPipelineobject bound to the pipeline bind point used by this command requires any dynamic state, that state must have been set forcommandBuffer -
If the
VkPipelineobject bound to the pipeline bind point used by this command accesses aVkSamplerobject that uses unnormalized coordinates, that sampler 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 the
VkPipelineobject bound to the pipeline bind point used by this command accesses aVkSamplerobject 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
VkPipelineobject bound to the pipeline bind point used by this command accesses aVkSamplerobject 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
VkPipelineobject 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
VkPipelineobject 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 theVkPipelineobject 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 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. -
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 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 -
taskCountmust be less than or equal toVkPhysicalDeviceMeshShaderPropertiesNV::maxDrawMeshTasksCount
-
commandBuffermust be a valid VkCommandBuffer handle -
commandBuffermust 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
-
Host access to
commandBuffermust be externally synchronized -
Host access to the
VkCommandPoolthatcommandBufferwas allocated from must be externally synchronized
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type |
|---|---|---|---|
Primary |
Inside |
Graphics |
Graphics |
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
Copyright (c) 2014-2020 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.