vulkan-3.26: Bindings to the Vulkan graphics API.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Vulkan.Extensions.VK_EXT_mesh_shader

Description

Name

VK_EXT_mesh_shader - device extension

VK_EXT_mesh_shader

Name String
VK_EXT_mesh_shader
Extension Type
Device extension
Registered Extension Number
329
Revision
1
Ratification Status
Not ratified
Extension and Version Dependencies
VK_KHR_spirv_1_4
Contact
Extension Proposal
VK_EXT_mesh_shader

Other Extension Metadata

Last Modified Date
2022-01-20
Interactions and External Dependencies
  • This extension requires SPV_EXT_mesh_shader
  • This extension provides API support for GLSL_EXT_mesh_shader
  • Interacts with Vulkan 1.1
  • Interacts with VK_KHR_multiview
  • Interacts with VK_KHR_fragment_shading_rate
Contributors
  • Christoph Kubisch, NVIDIA
  • Pat Brown, NVIDIA
  • Jeff Bolz, NVIDIA
  • Daniel Koch, NVIDIA
  • Piers Daniell, NVIDIA
  • Pierre Boudier, NVIDIA
  • Patrick Mours, NVIDIA
  • David Zhao Akeley, NVIDIA
  • Kedarnath Thangudu, NVIDIA
  • Timur Kristóf, Valve
  • Hans-Kristian Arntzen, Valve
  • Philip Rebohle, Valve
  • Mike Blumenkrantz, Valve
  • Slawomir Grajewski, Intel
  • Michal Pietrasiuk, Intel
  • Mariusz Merecki, Intel
  • Tom Olson, ARM
  • Jan-Harald Fredriksen, ARM
  • Sandeep Kakarlapudi, ARM
  • Ruihao Zhang, QUALCOMM
  • Ricardo Garcia, Igalia, S.L.
  • Tobias Hector, AMD
  • Stu Smith, AMD

Description

This extension provides a new mechanism allowing applications to generate collections of geometric primitives via programmable mesh shading. It is an alternative to the existing programmable primitive shading pipeline, which relied on generating input primitives by a fixed function assembler as well as fixed function vertex fetch.

This extension also adds support for the following SPIR-V extension in Vulkan:

New Commands

New Structures

New Enum Constants

If VK_NV_device_generated_commands is supported:

New or Modified Built-In Variables

  • PrimitivePointIndicesEXT
  • PrimitiveLineIndicesEXT
  • PrimitiveTriangleIndicesEXT
  • (modified)Position
  • (modified)PointSize
  • (modified)ClipDistance
  • (modified)CullDistance
  • (modified)PrimitiveId
  • (modified)Layer
  • (modified)ViewportIndex
  • (modified)NumWorkgroups
  • (modified)WorkgroupSize
  • (modified)WorkgroupId
  • (modified)LocalInvocationId
  • (modified)GlobalInvocationId
  • (modified)LocalInvocationIndex
  • (modified)NumSubgroups
  • (modified)SubgroupId
  • (modified)DrawIndex
  • (modified)PrimitiveShadingRateKHR
  • (modified)ViewIndex

New SPIR-V Capability

Version History

  • Revision 1, 2022-03-08 (Christoph Kubisch, Daniel Koch, Patrick Mours)

    • Initial revision

See Also

DrawMeshTasksIndirectCommandEXT, PhysicalDeviceMeshShaderFeaturesEXT, PhysicalDeviceMeshShaderPropertiesEXT, cmdDrawMeshTasksEXT, cmdDrawMeshTasksIndirectCountEXT, cmdDrawMeshTasksIndirectEXT

Document Notes

For more information, see the Vulkan Specification

This page is a generated document. Fixes and changes should be made to the generator scripts, not directly.

Synopsis

Documentation

cmdDrawMeshTasksEXT Source #

Arguments

:: forall io. MonadIO io 
=> CommandBuffer

commandBuffer is the command buffer into which the command will be recorded.

-> ("groupCountX" ::: Word32)

groupCountX is the number of local workgroups to dispatch in the X dimension.

-> ("groupCountY" ::: Word32)

groupCountY is the number of local workgroups to dispatch in the Y dimension.

-> ("groupCountZ" ::: Word32)

groupCountZ is the number of local workgroups to dispatch in the Z dimension.

-> io () 

vkCmdDrawMeshTasksEXT - Draw mesh task work items

Description

When the command is executed, a global workgroup consisting of groupCountX × groupCountY × groupCountZ local workgroups is assembled.

Valid Usage

Valid Usage (Implicit)

  • commandBuffer must be in the recording state
  • The CommandPool that commandBuffer was allocated from must support graphics operations
  • This command must only be called inside of a render pass instance
  • This command must only be called outside of a video coding scope

Host Synchronization

  • Host access to commandBuffer must be externally synchronized
  • Host access to the CommandPool that commandBuffer was allocated from must be externally synchronized

Command Properties

'

Command Buffer LevelsRender Pass ScopeVideo Coding ScopeSupported Queue TypesCommand Type
Primary SecondaryInside Outside Graphics Action

See Also

VK_EXT_mesh_shader, CommandBuffer

cmdDrawMeshTasksIndirectEXT Source #

Arguments

:: forall io. MonadIO io 
=> CommandBuffer

commandBuffer is the command buffer into which the command is recorded.

-> Buffer

buffer is the buffer containing draw parameters.

-> ("offset" ::: DeviceSize)

offset is the byte offset into buffer where parameters begin.

-> ("drawCount" ::: Word32)

drawCount is the number of draws to execute, and can be zero.

-> ("stride" ::: Word32)

stride is the byte stride between successive sets of draw parameters.

-> io () 

vkCmdDrawMeshTasksIndirectEXT - Issue an indirect mesh tasks draw into a command buffer

Description

cmdDrawMeshTasksIndirectEXT behaves similarly to cmdDrawMeshTasksEXT except that the parameters are read by the device from a buffer during execution. drawCount draws are executed by the command, with parameters taken from buffer starting at offset and increasing by stride bytes for each successive draw. The parameters of each draw are encoded in an array of DrawMeshTasksIndirectCommandEXT structures. If drawCount is less than or equal to one, stride is ignored.

Valid Usage

Valid Usage (Implicit)

  • buffer must be a valid Buffer handle
  • commandBuffer must be in the recording state
  • The CommandPool that commandBuffer was allocated from must support graphics operations
  • This command must only be called inside of a render pass instance
  • This command must only be called outside of a video coding scope
  • Both of buffer, and commandBuffer must have been created, allocated, or retrieved from the same Device

Host Synchronization

  • Host access to commandBuffer must be externally synchronized
  • Host access to the CommandPool that commandBuffer was allocated from must be externally synchronized

Command Properties

'

Command Buffer LevelsRender Pass ScopeVideo Coding ScopeSupported Queue TypesCommand Type
Primary SecondaryInside Outside Graphics Action

See Also

VK_EXT_mesh_shader, Buffer, CommandBuffer, DeviceSize

cmdDrawMeshTasksIndirectCountEXT Source #

Arguments

:: forall io. MonadIO io 
=> CommandBuffer

commandBuffer is the command buffer into which the command is recorded.

-> Buffer

buffer is the buffer containing draw parameters.

-> ("offset" ::: DeviceSize)

offset is the byte offset into buffer where parameters begin.

-> ("countBuffer" ::: Buffer)

countBuffer is the buffer containing the draw count.

-> ("countBufferOffset" ::: DeviceSize)

countBufferOffset is the byte offset into countBuffer where the draw count begins.

-> ("maxDrawCount" ::: Word32)

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 countBuffer and maxDrawCount.

-> ("stride" ::: Word32)

stride is the byte stride between successive sets of draw parameters.

-> io () 

vkCmdDrawMeshTasksIndirectCountEXT - Perform an indirect mesh tasks draw with the draw count sourced from a buffer

Description

cmdDrawMeshTasksIndirectCountEXT behaves similarly to cmdDrawMeshTasksIndirectEXT 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

Valid Usage (Implicit)

  • buffer must be a valid Buffer handle
  • countBuffer must be a valid Buffer handle
  • commandBuffer must be in the recording state
  • The CommandPool that commandBuffer was allocated from must support graphics operations
  • This command must only be called inside of a render pass instance
  • This command must only be called outside of a video coding scope
  • Each of buffer, commandBuffer, and countBuffer must have been created, allocated, or retrieved from the same Device

Host Synchronization

  • Host access to commandBuffer must be externally synchronized
  • Host access to the CommandPool that commandBuffer was allocated from must be externally synchronized

Command Properties

'

Command Buffer LevelsRender Pass ScopeVideo Coding ScopeSupported Queue TypesCommand Type
Primary SecondaryInside Outside Graphics Action

See Also

VK_EXT_mesh_shader, Buffer, CommandBuffer, DeviceSize

data PhysicalDeviceMeshShaderFeaturesEXT Source #

VkPhysicalDeviceMeshShaderFeaturesEXT - Structure describing mesh shading features that can be supported by an implementation

Description

If the PhysicalDeviceMeshShaderFeaturesEXT structure is included in the pNext chain of the PhysicalDeviceFeatures2 structure passed to getPhysicalDeviceFeatures2, it is filled in to indicate whether each corresponding feature is supported. PhysicalDeviceMeshShaderFeaturesEXT can also be used in the pNext chain of DeviceCreateInfo to selectively enable these features.

The corresponding features of the PhysicalDeviceMeshShaderFeaturesNV structure must match those in PhysicalDeviceMeshShaderFeaturesEXT.

Valid Usage

Valid Usage (Implicit)

See Also

VK_EXT_mesh_shader, Bool32, StructureType

Constructors

PhysicalDeviceMeshShaderFeaturesEXT 

Fields

Instances

Instances details
Storable PhysicalDeviceMeshShaderFeaturesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_mesh_shader

Show PhysicalDeviceMeshShaderFeaturesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_mesh_shader

Eq PhysicalDeviceMeshShaderFeaturesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_mesh_shader

FromCStruct PhysicalDeviceMeshShaderFeaturesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_mesh_shader

ToCStruct PhysicalDeviceMeshShaderFeaturesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_mesh_shader

Zero PhysicalDeviceMeshShaderFeaturesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_mesh_shader

data PhysicalDeviceMeshShaderPropertiesEXT Source #

VkPhysicalDeviceMeshShaderPropertiesEXT - Structure describing mesh shading properties

Members

The members of the PhysicalDeviceMeshShaderPropertiesEXT structure describe the following implementation-dependent limits:

Description

If the PhysicalDeviceMeshShaderPropertiesEXT structure is included in the pNext chain of PhysicalDeviceProperties2, it is filled with the implementation-dependent limits.

Valid Usage (Implicit)

See Also

VK_EXT_mesh_shader, Bool32, StructureType

Constructors

PhysicalDeviceMeshShaderPropertiesEXT 

Fields

  • maxTaskWorkGroupTotalCount :: Word32

    maxTaskWorkGroupTotalCount is the maximum number of total local workgroups that can be launched by a single mesh tasks drawing command. See https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#drawing-mesh-shading.

  • maxTaskWorkGroupCount :: (Word32, Word32, Word32)

    maxTaskWorkGroupCount[3] is the maximum number of local workgroups that can be launched by a single mesh tasks drawing command. These three values represent the maximum number of local workgroups for the X, Y, and Z dimensions, respectively. The workgroup count parameters to the drawing commands must be less than or equal to the corresponding limit. The product of these dimensions must be less than or equal to maxTaskWorkGroupTotalCount.

  • maxTaskWorkGroupInvocations :: Word32

    maxTaskWorkGroupInvocations is the maximum total number of task shader invocations in a single local workgroup. The product of the X, Y, and Z sizes, as specified by the LocalSize or LocalSizeId execution mode in shader modules or by the object decorated by the WorkgroupSize decoration, must be less than or equal to this limit.

  • maxTaskWorkGroupSize :: (Word32, Word32, Word32)

    maxTaskWorkGroupSize[3] is the maximum size of a local task workgroup, per dimension. These three values represent the maximum local workgroup size in the X, Y, and Z dimensions, respectively. The x, y, and z sizes, as specified by the LocalSize or LocalSizeId execution mode or by the object decorated by the WorkgroupSize decoration in shader modules, must be less than or equal to the corresponding limit.

  • maxTaskPayloadSize :: Word32

    maxTaskPayloadSize is the maximum total storage size, in bytes, available for variables declared with the TaskPayloadWorkgroupEXT storage class in shader modules in the task shader stage.

  • maxTaskSharedMemorySize :: Word32

    maxTaskSharedMemorySize is the maximum total storage size, in bytes, available for variables declared with the Workgroup storage class in shader modules in the task shader stage.

  • maxTaskPayloadAndSharedMemorySize :: Word32

    maxTaskPayloadAndSharedMemorySize is the maximum total storage size, in bytes, available for variables that are declared with the TaskPayloadWorkgroupEXT or Workgroup storage class, in shader modules in the task shader stage.

  • maxMeshWorkGroupTotalCount :: Word32

    maxMeshWorkGroupTotalCount is the maximum number of local output tasks a single task shader workgroup can emit.

  • maxMeshWorkGroupCount :: (Word32, Word32, Word32)

    maxMeshWorkGroupCount[3] is the maximum number of local output tasks a single task shader workgroup can emit, per dimension. These three values represent the maximum number of local output tasks for the X, Y, and Z dimensions, respectively. The workgroup count parameters to the OpEmitMeshTasksEXT must be less than or equal to the corresponding limit. The product of these dimensions must be less than or equal to maxMeshWorkGroupTotalCount.

  • maxMeshWorkGroupInvocations :: Word32

    maxMeshWorkGroupInvocations is the maximum total number of mesh shader invocations in a single local workgroup. The product of the X, Y, and Z sizes, as specified by the LocalSize or LocalSizeId execution mode in shader modules or by the object decorated by the WorkgroupSize decoration, must be less than or equal to this limit.

  • maxMeshWorkGroupSize :: (Word32, Word32, Word32)

    maxMeshWorkGroupSize[3] is the maximum size of a local mesh workgroup, per dimension. These three values represent the maximum local workgroup size in the X, Y, and Z dimensions, respectively. The x, y, and z sizes, as specified by the LocalSize or LocalSizeId execution mode or by the object decorated by the WorkgroupSize decoration in shader modules, must be less than or equal to the corresponding limit.

  • maxMeshSharedMemorySize :: Word32

    maxMeshSharedMemorySize is the maximum total storage size, in bytes, available for variables declared with the Workgroup storage class in shader modules in the mesh shader stage.

  • maxMeshPayloadAndSharedMemorySize :: Word32

    maxMeshPayloadAndSharedMemorySize is the maximum total storage size, in bytes, available for variables that are declared with the TaskPayloadWorkgroupEXT or Workgroup storage class in shader modules in the mesh shader stage.

  • maxMeshOutputMemorySize :: Word32

    maxMeshOutputMemorySize is the maximum total storage size, in bytes, available for output variables in shader modules in the mesh shader stage, according to the formula in Mesh Shader Output.

  • maxMeshPayloadAndOutputMemorySize :: Word32

    maxMeshPayloadAndOutputMemorySize is the maximum total storage size, in bytes, available for variables that are declared with the TaskPayloadWorkgroupEXT storage class, or output variables in shader modules in the mesh shader stage, according to the formula in Mesh Shader Output.

  • maxMeshOutputComponents :: Word32

    maxMeshOutputComponents is the maximum number of components of output variables which can be output from the mesh shader stage.

  • maxMeshOutputVertices :: Word32

    maxMeshOutputVertices is the maximum number of vertices which can be emitted by a single mesh shader workgroup.

  • maxMeshOutputPrimitives :: Word32

    maxMeshOutputPrimitives is the maximum number of primitives which can be emitted by a single mesh shader workgroup.

  • maxMeshOutputLayers :: Word32

    maxMeshOutputLayers is one greater than the maximum layer index that can be output from the mesh shader stage.

  • maxMeshMultiviewViewCount :: Word32

    maxMeshMultiviewViewCount is one greater than the maximum view index that can be used by any mesh shader.

  • meshOutputPerVertexGranularity :: Word32

    meshOutputPerVertexGranularity is the granularity of vertex allocation. The number of output vertices allocated for the mesh shader stage is padded to a multiple of this number. The value can be used to calculate the required storage size for output variables in shader modules in the mesh shader stage, which must be less than or equal to maxMeshOutputMemorySize.

  • meshOutputPerPrimitiveGranularity :: Word32

    meshOutputPerPrimitiveGranularity is the granularity of primitive allocation. The number of output primitives allocated for the mesh shader stage is padded to a multiple of this number. The value can be used to calculate the required storage size for output variables in shader modules in the mesh shader stage, which must be less than or equal to maxMeshOutputMemorySize.

  • maxPreferredTaskWorkGroupInvocations :: Word32

    maxPreferredTaskWorkGroupInvocations is the maximum number of task shader invocations in a single workgroup that is preferred by the implementation for optimal performance. The value is guaranteed to be a multiple of a supported subgroup size for the task shader stage.

  • maxPreferredMeshWorkGroupInvocations :: Word32

    maxPreferredMeshWorkGroupInvocations is the maximum number of mesh shader invocations in a single workgroup that is preferred by the implementation for optimal performance. The value is guaranteed to be a multiple of a supported subgroup size for the mesh shader stage.

  • prefersLocalInvocationVertexOutput :: Bool

    prefersLocalInvocationVertexOutput specifies whether writes to the vertex output array in a mesh shader yield best performance when the array index matches LocalInvocationIndex.

  • prefersLocalInvocationPrimitiveOutput :: Bool

    prefersLocalInvocationPrimitiveOutput specifies whether writes to the primitive output array in a mesh shader yield best performance when the array index matches LocalInvocationIndex.

  • prefersCompactVertexOutput :: Bool

    prefersCompactVertexOutput specifies whether output vertices should be compacted after custom culling in the mesh shader for best performance, otherwise keeping the vertices at their original location may be better.

  • prefersCompactPrimitiveOutput :: Bool

    prefersCompactPrimitiveOutput specifies whether output primitives should be compacted after custom culling in the mesh shader for best performance, otherwise the use of CullPrimitiveEXT may be better.

Instances

Instances details
Storable PhysicalDeviceMeshShaderPropertiesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_mesh_shader

Show PhysicalDeviceMeshShaderPropertiesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_mesh_shader

Eq PhysicalDeviceMeshShaderPropertiesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_mesh_shader

FromCStruct PhysicalDeviceMeshShaderPropertiesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_mesh_shader

ToCStruct PhysicalDeviceMeshShaderPropertiesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_mesh_shader

Zero PhysicalDeviceMeshShaderPropertiesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_mesh_shader

data DrawMeshTasksIndirectCommandEXT Source #

VkDrawMeshTasksIndirectCommandEXT - Structure specifying a mesh tasks draw indirect command

Description

The members of DrawMeshTasksIndirectCommandEXT have the same meaning as the similarly named parameters of cmdDrawMeshTasksEXT.

Valid Usage

See Also

VK_EXT_mesh_shader, cmdDrawMeshTasksIndirectEXT

Constructors

DrawMeshTasksIndirectCommandEXT 

Fields

  • groupCountX :: Word32

    groupCountX is the number of local workgroups to dispatch in the X dimension.

  • groupCountY :: Word32

    groupCountY is the number of local workgroups to dispatch in the Y dimension.

  • groupCountZ :: Word32

    groupCountZ is the number of local workgroups to dispatch in the Z dimension.

Instances

Instances details
Storable DrawMeshTasksIndirectCommandEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_mesh_shader

Show DrawMeshTasksIndirectCommandEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_mesh_shader

Eq DrawMeshTasksIndirectCommandEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_mesh_shader

FromCStruct DrawMeshTasksIndirectCommandEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_mesh_shader

ToCStruct DrawMeshTasksIndirectCommandEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_mesh_shader

Zero DrawMeshTasksIndirectCommandEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_mesh_shader

pattern EXT_MESH_SHADER_SPEC_VERSION :: forall a. Integral a => a Source #

type EXT_MESH_SHADER_EXTENSION_NAME = "VK_EXT_mesh_shader" Source #

pattern EXT_MESH_SHADER_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a Source #

newtype IndirectCommandsTokenTypeNV Source #

Instances

Instances details
Storable IndirectCommandsTokenTypeNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_device_generated_commands

Read IndirectCommandsTokenTypeNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_device_generated_commands

Show IndirectCommandsTokenTypeNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_device_generated_commands

Eq IndirectCommandsTokenTypeNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_device_generated_commands

Ord IndirectCommandsTokenTypeNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_device_generated_commands

Zero IndirectCommandsTokenTypeNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_device_generated_commands