C Specification
To record a draw that uses the mesh pipeline, call:
void vkCmdDrawMeshTasksNV(
VkCommandBuffer commandBuffer,
uint32_t taskCount,
uint32_t firstTask);
Parameters
-
commandBuffer
is the command buffer into which the command will be recorded. -
taskCount
is the number of local workgroups to dispatch in the X dimension. Y and Z dimension are implicitly set to one. -
firstTask
is 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
VkImageView
is sampled withVK_FILTER_LINEAR
as a result of this command, then the image view’s format features must containVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
-
If a
VkImageView
is 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
VkImageView
is sampled withVK_FILTER_CUBIC_EXT
as 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_EXT
as a result of this command must have a VkImageViewType and format that supports cubic filtering, as specified byVkFilterCubicImageViewImageFormatPropertiesEXT
::filterCubic
returned byvkGetPhysicalDeviceImageFormatProperties2
-
Any VkImageView being sampled with
VK_FILTER_CUBIC_EXT
with a reduction mode of eitherVK_SAMPLER_REDUCTION_MODE_MIN_EXT
orVK_SAMPLER_REDUCTION_MODE_MAX_EXT
as a result of this command must have a VkImageViewType and format that supports cubic filtering together with minmax filtering, as specified byVkFilterCubicImageViewImageFormatPropertiesEXT
::filterCubicMinmax
returned byvkGetPhysicalDeviceImageFormatProperties2
-
Any VkImage created with a VkImageCreateInfo::
flags
containingVK_IMAGE_CREATE_CORNER_SAMPLED_BIT_NV
sampled 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
VkPipeline
bound 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 aVkPipelineLayout
that is compatible for set n, with theVkPipelineLayout
used to create the currentVkPipeline
, as described in [descriptorsets-compatibility] -
For each push constant that is statically used by the
VkPipeline
bound to the pipeline bind point used by this command, a push constant value must have been set for the same pipeline bind point, with aVkPipelineLayout
that is compatible for push constants, with theVkPipelineLayout
used 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 theVkPipeline
bound 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
VkPipeline
object bound to the pipeline bind point used by this command requires any dynamic state, that state must have been set forcommandBuffer
-
If the
VkPipeline
object bound to the pipeline bind point used by this command accesses aVkSampler
object that uses unnormalized coordinates, that sampler must not be used to sample from anyVkImage
with aVkImageView
of the typeVK_IMAGE_VIEW_TYPE_3D
,VK_IMAGE_VIEW_TYPE_CUBE
,VK_IMAGE_VIEW_TYPE_1D_ARRAY
,VK_IMAGE_VIEW_TYPE_2D_ARRAY
orVK_IMAGE_VIEW_TYPE_CUBE_ARRAY
, in any shader stage -
If the
VkPipeline
object bound to the pipeline bind point used by this command accesses aVkSampler
object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*
orOpImageSparseSample*
instructions withImplicitLod
,Dref
orProj
in their name, in any shader stage -
If the
VkPipeline
object bound to the pipeline bind point used by this command accesses aVkSampler
object 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
VkPipeline
object 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
VkPipeline
object 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
commandBuffer
is an unprotected command buffer, any resource accessed by theVkPipeline
object 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
renderPass
member of theVkGraphicsPipelineCreateInfo
structure specified when creating theVkPipeline
bound toVK_PIPELINE_BIND_POINT_GRAPHICS
. -
The subpass index of the current render pass must be equal to the
subpass
member of theVkGraphicsPipelineCreateInfo
structure specified when creating theVkPipeline
bound 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::
sampleLocationsEnable
set toVK_TRUE
and the current subpass has a depth/stencil attachment, then that attachment must have been created with theVK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT
bit set -
taskCount
must be less than or equal toVkPhysicalDeviceMeshShaderPropertiesNV
::maxDrawMeshTasksCount
-
commandBuffer
must be in the recording state -
The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics operations -
This command must only be called inside of a render pass instance
-
Host access to
commandBuffer
must be externally synchronized -
Host access to the
VkCommandPool
thatcommandBuffer
was 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-2019 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.