[[drawing-mesh-shading]] == Programmable Mesh Shading In this drawing approach, primitives are assembled by the mesh shader stage. <> operates similarly to <> as the shaders make use of workgroups. [open,refpage='vkCmdDrawMeshTasksNV',desc='Draw mesh task work items',type='protos'] -- To record a draw that uses the mesh pipeline, call: include::../../api/protos/vkCmdDrawMeshTasksNV.txt[] * pname:commandBuffer is the command buffer into which the command will be recorded. * pname:taskCount is the number of local workgroups to dispatch in the X dimension. Y and Z dimension are implicitly set to one. * pname:firstTask is the X component of the first workgroup ID. When the command is executed, a global workgroup consisting of pname:taskCount local workgroups is assembled. .Valid Usage **** * [[VUID-vkCmdDrawMeshTasksNV-taskCount-02119]] pname:taskCount must: be less than or equal to sname:VkPhysicalDeviceMeshShaderPropertiesNV::pname:maxDrawMeshTasksCount * [[VUID-vkCmdDrawMeshTasksNV-renderPass-02120]] The current render pass must: be <> with the pname:renderPass member of the sname:VkGraphicsPipelineCreateInfo structure specified when creating the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS. * [[VUID-vkCmdDrawMeshTasksNV-subpass-02121]] The subpass index of the current render pass must: be equal to the pname:subpass member of the sname:VkGraphicsPipelineCreateInfo structure specified when creating the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS. * [[VUID-vkCmdDrawMeshTasksNV-None-02122]] For each set _n_ that is statically used by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must: have been bound to _n_ at ename:VK_PIPELINE_BIND_POINT_GRAPHICS, with a sname:VkPipelineLayout that is compatible for set _n_, with the sname:VkPipelineLayout used to create the current sname:VkPipeline, as described in <> * [[VUID-vkCmdDrawMeshTasksNV-None-02123]] For each push constant that is statically used by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must: have been set for ename:VK_PIPELINE_BIND_POINT_GRAPHICS, with a sname:VkPipelineLayout that is compatible for push constants, with the sname:VkPipelineLayout used to create the current sname:VkPipeline, as described in <> * [[VUID-vkCmdDrawMeshTasksNV-None-02124]] Descriptors in each bound descriptor set, specified via fname:vkCmdBindDescriptorSets, must: be valid if they are statically used by the currently bound sname:VkPipeline object, specified via fname:vkCmdBindPipeline * [[VUID-vkCmdDrawMeshTasksNV-None-02125]] A valid graphics pipeline must: be bound to the current command buffer with ename:VK_PIPELINE_BIND_POINT_GRAPHICS * [[VUID-vkCmdDrawMeshTasksNV-None-02126]] If the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must: have been set on the current command buffer * [[VUID-vkCmdDrawMeshTasksNV-None-02127]] Every input attachment used by the current subpass must: be bound to the pipeline via a descriptor set * [[VUID-vkCmdDrawMeshTasksNV-None-02128]] If any sname:VkSampler object that is accessed from a shader by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must: not be used to sample from any sname:VkImage with a sname:VkImageView of the type ename:VK_IMAGE_VIEW_TYPE_3D, ename:VK_IMAGE_VIEW_TYPE_CUBE, ename:VK_IMAGE_VIEW_TYPE_1D_ARRAY, ename:VK_IMAGE_VIEW_TYPE_2D_ARRAY or ename:VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage * [[VUID-vkCmdDrawMeshTasksNV-None-02129]] If any sname:VkSampler object that is accessed from a shader by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must: not be used with any of the SPIR-V `OpImageSample*` or `OpImageSparseSample*` instructions with code:ImplicitLod, code:Dref or code:Proj in their name, in any shader stage * [[VUID-vkCmdDrawMeshTasksNV-None-02130]] If any sname:VkSampler object that is accessed from a shader by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must: not be used with any of the SPIR-V `OpImageSample*` or `OpImageSparseSample*` instructions that includes a LOD bias or any offset values, in any shader stage * [[VUID-vkCmdDrawMeshTasksNV-None-02131]] If the <> feature is not enabled, and any shader stage in the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must: not access values outside of the range of that buffer specified in the currently bound descriptor set * [[VUID-vkCmdDrawMeshTasksNV-None-02132]] If the <> feature is not enabled, and any shader stage in the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must: not access values outside of the range of that buffer specified in the currently bound descriptor set * [[VUID-vkCmdDrawMeshTasksNV-linearTilingFeatures-02133]] Any sname:VkImageView being sampled with ename:VK_FILTER_LINEAR as a result of this command must: be of a format which supports linear filtering, as specified by the ename:VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in sname:VkFormatProperties::pname:linearTilingFeatures (for a linear image) or sname:VkFormatProperties::pname:optimalTilingFeatures(for an optimally tiled image) returned by fname:vkGetPhysicalDeviceFormatProperties * [[VUID-vkCmdDrawMeshTasksNV-None-02134]] 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. ifdef::VK_IMG_filter_cubic[] * [[VUID-vkCmdDrawMeshTasksNV-linearTilingFeatures-02135]] Any slink:VkImageView being sampled with ename:VK_FILTER_CUBIC_IMG as a result of this command must: be of a format which supports cubic filtering, as specified by the ename:VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG flag in sname:VkFormatProperties::pname:linearTilingFeatures (for a linear image) or sname:VkFormatProperties::pname:optimalTilingFeatures(for an optimally tiled image) returned by fname:vkGetPhysicalDeviceFormatProperties * [[VUID-vkCmdDrawMeshTasksNV-None-02136]] Any slink:VkImageView being sampled with ename:VK_FILTER_CUBIC_IMG as a result of this command must: not have a elink:VkImageViewType of ename:VK_IMAGE_VIEW_TYPE_3D, ename:VK_IMAGE_VIEW_TYPE_CUBE, or ename:VK_IMAGE_VIEW_TYPE_CUBE_ARRAY endif::VK_IMG_filter_cubic[] ifdef::VK_KHR_multiview[] * [[VUID-vkCmdDrawMeshTasksNV-maxMultiviewInstanceIndex-02137]] If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must: be less than or equal to slink:VkPhysicalDeviceMultiviewProperties::pname:maxMultiviewInstanceIndex. endif::VK_KHR_multiview[] ifdef::VK_VERSION_1_1[] * [[VUID-vkCmdDrawMeshTasksNV-commandBuffer-02138]] If pname:commandBuffer is an unprotected command buffer, and any pipeline stage in the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, that image or buffer must: not be a protected image or protected buffer. * [[VUID-vkCmdDrawMeshTasksNV-commandBuffer-02139]] If pname:commandBuffer is a protected command buffer, and any pipeline stage in the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS writes to any image or buffer, that image or buffer must: not be an unprotected image or unprotected buffer. * [[VUID-vkCmdDrawMeshTasksNV-commandBuffer-02140]] If pname:commandBuffer is a protected command buffer, and any pipeline stage other than the framebuffer-space pipeline stages in the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, the image or buffer must: not be a protected image or protected buffer. endif::VK_VERSION_1_1[] ifdef::VK_EXT_sample_locations[] * [[VUID-vkCmdDrawMeshTasksNV-sampleLocationsEnable-02141]] If the currently bound graphics pipeline was created with slink:VkPipelineSampleLocationsStateCreateInfoEXT::pname:sampleLocationsEnable set to ename:VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must: have been created with the ename:VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set endif::VK_EXT_sample_locations[] ifdef::VK_NV_corner_sampled_image[] * [[VUID-vkCmdDrawMeshTasksNV-flags-02142]] Any slink:VkImage created with a slink:VkImageCreateInfo::pname:flags containing ename:VK_IMAGE_CREATE_CORNER_SAMPLED_BIT_NV sampled as a result of this command must: only be sampled using a slink:VkSamplerAddressMode of ename:VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE. endif::VK_NV_corner_sampled_image[] **** include::../../validity/protos/vkCmdDrawMeshTasksNV.txt[] -- [open,refpage='vkCmdDrawMeshTasksIndirectNV',desc='Issue an indirect mesh tasks draw into a command buffer',type='protos'] -- To record an indirect mesh tasks draw, call: include::../../api/protos/vkCmdDrawMeshTasksIndirectNV.txt[] * pname:commandBuffer is the command buffer into which the command is recorded. * pname:buffer is the buffer containing draw parameters. * pname:offset is the byte offset into pname:buffer where parameters begin. * pname:drawCount is the number of draws to execute, and can: be zero. * pname:stride is the byte stride between successive sets of draw parameters. fname:vkCmdDrawMeshTasksIndirectNV behaves similarly to flink:vkCmdDrawMeshTasksNV except that the parameters are read by the device from a buffer during execution. pname:drawCount draws are executed by the command, with parameters taken from pname:buffer starting at pname:offset and increasing by pname:stride bytes for each successive draw. The parameters of each draw are encoded in an array of slink:VkDrawMeshTasksIndirectCommandNV structures. If pname:drawCount is less than or equal to one, pname:stride is ignored. .Valid Usage **** * [[VUID-vkCmdDrawMeshTasksIndirectNV-buffer-02143]] If pname:buffer is non-sparse then it must: be bound completely and contiguously to a single sname:VkDeviceMemory object * [[VUID-vkCmdDrawMeshTasksIndirectNV-buffer-02144]] pname:buffer must: have been created with the ename:VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set * [[VUID-vkCmdDrawMeshTasksIndirectNV-offset-02145]] pname:offset must: be a multiple of `4` * [[VUID-vkCmdDrawMeshTasksIndirectNV-drawCount-02146]] If pname:drawCount is greater than `1`, pname:stride must: be a multiple of `4` and must: be greater than or equal to code:sizeof(sname:VkDrawMeshTasksIndirectCommandNV) * [[VUID-vkCmdDrawMeshTasksIndirectNV-drawCount-02147]] If the <> feature is not enabled, pname:drawCount must: be `0` or `1` * [[VUID-vkCmdDrawMeshTasksIndirectNV-renderPass-02148]] The current render pass must: be <> with the pname:renderPass member of the sname:VkGraphicsPipelineCreateInfo structure specified when creating the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS. * [[VUID-vkCmdDrawMeshTasksIndirectNV-subpass-02149]] The subpass index of the current render pass must: be equal to the pname:subpass member of the sname:VkGraphicsPipelineCreateInfo structure specified when creating the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS. * [[VUID-vkCmdDrawMeshTasksIndirectNV-None-02150]] For each set _n_ that is statically used by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must: have been bound to _n_ at ename:VK_PIPELINE_BIND_POINT_GRAPHICS, with a sname:VkPipelineLayout that is compatible for set _n_, with the sname:VkPipelineLayout used to create the current sname:VkPipeline, as described in <> * [[VUID-vkCmdDrawMeshTasksIndirectNV-None-02151]] For each push constant that is statically used by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must: have been set for ename:VK_PIPELINE_BIND_POINT_GRAPHICS, with a sname:VkPipelineLayout that is compatible for push constants, with the sname:VkPipelineLayout used to create the current sname:VkPipeline, as described in <> * [[VUID-vkCmdDrawMeshTasksIndirectNV-None-02152]] Descriptors in each bound descriptor set, specified via fname:vkCmdBindDescriptorSets, must: be valid if they are statically used by the currently bound sname:VkPipeline object, specified via fname:vkCmdBindPipeline * [[VUID-vkCmdDrawMeshTasksIndirectNV-None-02153]] All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point's interface must: have valid buffers bound * [[VUID-vkCmdDrawMeshTasksIndirectNV-None-02154]] A valid graphics pipeline must: be bound to the current command buffer with ename:VK_PIPELINE_BIND_POINT_GRAPHICS * [[VUID-vkCmdDrawMeshTasksIndirectNV-None-02155]] If the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must: have been set on the current command buffer * [[VUID-vkCmdDrawMeshTasksIndirectNV-drawCount-02156]] If pname:drawCount is equal to `1`, [eq]#(pname:offset {plus} code:sizeof(slink:VkDrawMeshTasksIndirectCommandNV))# must: be less than or equal to the size of pname:buffer * [[VUID-vkCmdDrawMeshTasksIndirectNV-drawCount-02157]] If pname:drawCount is greater than `1`, [eq]#(pname:stride {times} (pname:drawCount - 1) {plus} pname:offset {plus} code:sizeof(slink:VkDrawMeshTasksIndirectCommandNV))# must: be less than or equal to the size of pname:buffer * [[VUID-vkCmdDrawMeshTasksIndirectNV-drawCount-02158]] pname:drawCount must: be less than or equal to sname:VkPhysicalDeviceLimits::pname:maxDrawIndirectCount * [[VUID-vkCmdDrawMeshTasksIndirectNV-None-02159]] Every input attachment used by the current subpass must: be bound to the pipeline via a descriptor set * [[VUID-vkCmdDrawMeshTasksIndirectNV-None-02160]] If any sname:VkSampler object that is accessed from a shader by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must: not be used to sample from any sname:VkImage with a sname:VkImageView of the type ename:VK_IMAGE_VIEW_TYPE_3D, ename:VK_IMAGE_VIEW_TYPE_CUBE, ename:VK_IMAGE_VIEW_TYPE_1D_ARRAY, ename:VK_IMAGE_VIEW_TYPE_2D_ARRAY or ename:VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage * [[VUID-vkCmdDrawMeshTasksIndirectNV-None-02161]] If any sname:VkSampler object that is accessed from a shader by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must: not be used with any of the SPIR-V `OpImageSample*` or `OpImageSparseSample*` instructions with code:ImplicitLod, code:Dref or code:Proj in their name, in any shader stage * [[VUID-vkCmdDrawMeshTasksIndirectNV-None-02162]] If any sname:VkSampler object that is accessed from a shader by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must: not be used with any of the SPIR-V `OpImageSample*` or `OpImageSparseSample*` instructions that includes a LOD bias or any offset values, in any shader stage * [[VUID-vkCmdDrawMeshTasksIndirectNV-None-02163]] If the <> feature is not enabled, and any shader stage in the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must: not access values outside of the range of that buffer specified in the currently bound descriptor set * [[VUID-vkCmdDrawMeshTasksIndirectNV-None-02164]] If the <> feature is not enabled, and any shader stage in the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must: not access values outside of the range of that buffer specified in the currently bound descriptor set * [[VUID-vkCmdDrawMeshTasksIndirectNV-linearTilingFeatures-02165]] Any sname:VkImageView being sampled with ename:VK_FILTER_LINEAR as a result of this command must: be of a format which supports linear filtering, as specified by the ename:VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in sname:VkFormatProperties::pname:linearTilingFeatures (for a linear image) or sname:VkFormatProperties::pname:optimalTilingFeatures(for an optimally tiled image) returned by fname:vkGetPhysicalDeviceFormatProperties * [[VUID-vkCmdDrawMeshTasksIndirectNV-None-02166]] 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. ifdef::VK_IMG_filter_cubic[] * [[VUID-vkCmdDrawMeshTasksIndirectNV-linearTilingFeatures-02167]] Any slink:VkImageView being sampled with ename:VK_FILTER_CUBIC_IMG as a result of this command must: be of a format which supports cubic filtering, as specified by the ename:VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG flag in sname:VkFormatProperties::pname:linearTilingFeatures (for a linear image) or sname:VkFormatProperties::pname:optimalTilingFeatures(for an optimally tiled image) returned by fname:vkGetPhysicalDeviceFormatProperties * [[VUID-vkCmdDrawMeshTasksIndirectNV-None-02168]] Any slink:VkImageView being sampled with ename:VK_FILTER_CUBIC_IMG as a result of this command must: not have a elink:VkImageViewType of ename:VK_IMAGE_VIEW_TYPE_3D, ename:VK_IMAGE_VIEW_TYPE_CUBE, or ename:VK_IMAGE_VIEW_TYPE_CUBE_ARRAY endif::VK_IMG_filter_cubic[] ifdef::VK_KHR_multiview[] * [[VUID-vkCmdDrawMeshTasksIndirectNV-maxMultiviewInstanceIndex-02169]] If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must: be less than or equal to slink:VkPhysicalDeviceMultiviewProperties::pname:maxMultiviewInstanceIndex. endif::VK_KHR_multiview[] ifdef::VK_VERSION_1_1[] * [[VUID-vkCmdDrawMeshTasksIndirectNV-commandBuffer-02170]] If pname:commandBuffer is an unprotected command buffer, and any pipeline stage in the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, that image or buffer must: not be a protected image or protected buffer. * [[VUID-vkCmdDrawMeshTasksIndirectNV-commandBuffer-02171]] If pname:commandBuffer is a protected command buffer, and any pipeline stage in the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS writes to any image or buffer, that image or buffer must: not be an unprotected image or unprotected buffer. * [[VUID-vkCmdDrawMeshTasksIndirectNV-commandBuffer-02172]] If pname:commandBuffer is a protected command buffer, and any pipeline stage other than the framebuffer-space pipeline stages in the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, the image or buffer must: not be a protected image or protected buffer. endif::VK_VERSION_1_1[] ifdef::VK_EXT_sample_locations[] * [[VUID-vkCmdDrawMeshTasksIndirectNV-sampleLocationsEnable-02173]] If the currently bound graphics pipeline was created with slink:VkPipelineSampleLocationsStateCreateInfoEXT::pname:sampleLocationsEnable set to ename:VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must: have been created with the ename:VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set endif::VK_EXT_sample_locations[] ifdef::VK_NV_corner_sampled_image[] * [[VUID-vkCmdDrawMeshTasksIndirectNV-flags-02174]] Any slink:VkImage created with a slink:VkImageCreateInfo::pname:flags containing ename:VK_IMAGE_CREATE_CORNER_SAMPLED_BIT_NV sampled as a result of this command must: only be sampled using a slink:VkSamplerAddressMode of ename:VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE. endif::VK_NV_corner_sampled_image[] **** include::../../validity/protos/vkCmdDrawMeshTasksIndirectNV.txt[] -- [open,refpage='VkDrawMeshTasksIndirectCommandNV',desc='Structure specifying a mesh tasks draw indirect command',type='structs',xrefs='vkCmdDrawMeshTasksIndirectNV'] -- The sname:VkDrawMeshTasksIndirectCommandNV structure is defined as: include::../../api/structs/VkDrawMeshTasksIndirectCommandNV.txt[] * pname:taskCount is the number of local workgroups to dispatch in the X dimension. Y and Z dimension are implicitly set to one. * pname:firstTask is the X component of the first workgroup ID. The members of sname:VkDrawMeshTasksIndirectCommandNV have the same meaning as the similarly named parameters of flink:vkCmdDrawMeshTasksNV. .Valid Usage **** * [[VUID-VkDrawMeshTasksIndirectCommandNV-taskCount-02175]] pname:taskCount must: be less than or equal to sname:VkPhysicalDeviceMeshShaderPropertiesNV::pname:maxDrawMeshTasksCount **** include::../../validity/structs/VkDrawMeshTasksIndirectCommandNV.txt[] -- [open,refpage='vkCmdDrawMeshTasksIndirectCountNV',desc='Perform an indirect mesh tasks draw with the draw count sourced from a buffer',type='protos'] -- To record an indirect mesh tasks draw with the draw count sourced from a buffer, call: include::../../api/protos/vkCmdDrawMeshTasksIndirectCountNV.txt[] * pname:commandBuffer is the command buffer into which the command is recorded. * pname:buffer is the buffer containing draw parameters. * pname:offset is the byte offset into pname:buffer where parameters begin. * pname:countBuffer is the buffer containing the draw count. * pname:countBufferOffset is the byte offset into pname:countBuffer where the draw count begins. * pname:maxDrawCount specifies the maximum number of draws that will be executed. The actual number of executed draw calls is the minimum of the count specified in pname:countBuffer and pname:maxDrawCount. * pname:stride is the byte stride between successive sets of draw parameters. fname:vkCmdDrawMeshTasksIndirectCountNV behaves similarly to flink:vkCmdDrawMeshTasksIndirectNV 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 pname:countBuffer located at pname:countBufferOffset and use this as the draw count. .Valid Usage **** * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-buffer-02176]] If pname:buffer is non-sparse then it must: be bound completely and contiguously to a single sname:VkDeviceMemory object * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-buffer-02177]] pname:buffer must: have been created with the ename:VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-countBuffer-02178]] If pname:countBuffer is non-sparse then it must: be bound completely and contiguously to a single sname:VkDeviceMemory object * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-countBuffer-02179]] pname:countBuffer must: have been created with the ename:VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-offset-02180]] pname:offset must: be a multiple of `4` * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-countBufferOffset-02181]] pname:countBufferOffset must: be a multiple of `4` * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-stride-02182]] pname:stride must: be a multiple of `4` and must: be greater than or equal to code:sizeof(sname:VkDrawMeshTasksIndirectCommandNV) * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-maxDrawCount-02183]] If pname:maxDrawCount is greater than or equal to `1`, [eq]#(pname:stride {times} (pname:maxDrawCount - 1) {plus} pname:offset {plus} code:sizeof(sname:VkDrawMeshTasksIndirectCommandNV))# must: be less than or equal to the size of pname:buffer * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-renderPass-02184]] The current render pass must: be <> with the pname:renderPass member of the sname:VkGraphicsPipelineCreateInfo structure specified when creating the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS. * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-subpass-02185]] The subpass index of the current render pass must: be equal to the pname:subpass member of the sname:VkGraphicsPipelineCreateInfo structure specified when creating the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS. * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-None-02186]] For each set _n_ that is statically used by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS, a descriptor set must: have been bound to _n_ at ename:VK_PIPELINE_BIND_POINT_GRAPHICS, with a sname:VkPipelineLayout that is compatible for set _n_, with the sname:VkPipelineLayout used to create the current sname:VkPipeline, as described in <> * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-None-02187]] For each push constant that is statically used by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS, a push constant value must: have been set for ename:VK_PIPELINE_BIND_POINT_GRAPHICS, with a sname:VkPipelineLayout that is compatible for push constants, with the sname:VkPipelineLayout used to create the current sname:VkPipeline, as described in <> * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-None-02188]] Descriptors in each bound descriptor set, specified via fname:vkCmdBindDescriptorSets, must: be valid if they are statically used by the currently bound sname:VkPipeline object, specified via fname:vkCmdBindPipeline * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-None-02189]] A valid graphics pipeline must: be bound to the current command buffer with ename:VK_PIPELINE_BIND_POINT_GRAPHICS * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-None-02190]] If the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS requires any dynamic state, that state must: have been set on the current command buffer * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-countBuffer-02191]] If the count stored in pname:countBuffer is equal to `1`, [eq]#(pname:offset {plus} code:sizeof(sname:VkDrawMeshTasksIndirectCommandNV))# must: be less than or equal to the size of pname:buffer * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-countBuffer-02192]] If the count stored in pname:countBuffer is greater than `1`, [eq]#(pname:stride {times} (pname:drawCount - 1) {plus} pname:offset {plus} code:sizeof(sname:VkDrawMeshTasksIndirectCommandNV))# must: be less than or equal to the size of pname:buffer * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-countBuffer-02193]] The count stored in pname:countBuffer must: be less than or equal to sname:VkPhysicalDeviceLimits::pname:maxDrawIndirectCount * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-None-02194]] Every input attachment used by the current subpass must: be bound to the pipeline via a descriptor set * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-None-02195]] If any sname:VkSampler object that is accessed from a shader by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must: not be used to sample from any sname:VkImage with a sname:VkImageView of the type ename:VK_IMAGE_VIEW_TYPE_3D, ename:VK_IMAGE_VIEW_TYPE_CUBE, ename:VK_IMAGE_VIEW_TYPE_1D_ARRAY, ename:VK_IMAGE_VIEW_TYPE_2D_ARRAY or ename:VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-None-02196]] If any sname:VkSampler object that is accessed from a shader by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must: not be used with any of the SPIR-V `OpImageSample*` or `OpImageSparseSample*` instructions with code:ImplicitLod, code:Dref or code:Proj in their name, in any shader stage * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-None-02197]] If any sname:VkSampler object that is accessed from a shader by the sname:VkPipeline currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS uses unnormalized coordinates, it must: not be used with any of the SPIR-V `OpImageSample*` or `OpImageSparseSample*` instructions that includes a LOD bias or any offset values, in any shader stage * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-None-02198]] If the <> feature is not enabled, and any shader stage in the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS accesses a uniform buffer, it must: not access values outside of the range of that buffer specified in the currently bound descriptor set * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-None-02199]] If the <> feature is not enabled, and any shader stage in the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS accesses a storage buffer, it must: not access values outside of the range of that buffer specified in the currently bound descriptor set * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-linearTilingFeatures-02200]] Any sname:VkImageView being sampled with ename:VK_FILTER_LINEAR as a result of this command must: be of a format which supports linear filtering, as specified by the ename:VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT flag in sname:VkFormatProperties::pname:linearTilingFeatures (for a linear image) or sname:VkFormatProperties::pname:optimalTilingFeatures(for an optimally tiled image) returned by fname:vkGetPhysicalDeviceFormatProperties * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-None-02201]] 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. ifdef::VK_KHR_multiview[] * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-maxMultiviewInstanceIndex-02202]] If the draw is recorded in a render pass instance with multiview enabled, the maximum instance index must: be less than or equal to slink:VkPhysicalDeviceMultiviewProperties::pname:maxMultiviewInstanceIndex. endif::VK_KHR_multiview[] ifdef::VK_VERSION_1_1[] * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-commandBuffer-02203]] If pname:commandBuffer is an unprotected command buffer, and any pipeline stage in the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, that image or buffer must: not be a protected image or protected buffer. * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-commandBuffer-02204]] If pname:commandBuffer is a protected command buffer, and any pipeline stage in the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS writes to any image or buffer, that image or buffer must: not be an unprotected image or unprotected buffer. * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-commandBuffer-02205]] If pname:commandBuffer is a protected command buffer, and any pipeline stage other than the framebuffer-space pipeline stages in the sname:VkPipeline object currently bound to ename:VK_PIPELINE_BIND_POINT_GRAPHICS reads from or writes to any image or buffer, the image or buffer must: not be a protected image or protected buffer. endif::VK_VERSION_1_1[] ifdef::VK_EXT_sample_locations[] * [[VUID-vkCmdDrawMeshTasksIndirectCountNV-sampleLocationsEnable-02206]] If the currently bound graphics pipeline was created with slink:VkPipelineSampleLocationsStateCreateInfoEXT::pname:sampleLocationsEnable set to ename:VK_TRUE and the current subpass has a depth/stencil attachment, then that attachment must: have been created with the ename:VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit set endif::VK_EXT_sample_locations[] **** include::../../validity/protos/vkCmdDrawMeshTasksIndirectCountNV.txt[] --