vulkan
Safe HaskellNone
LanguageHaskell2010

Vulkan.Extensions.VK_NV_mesh_shader

Description

Name

VK_NV_mesh_shader - device extension

VK_NV_mesh_shader

Name String
VK_NV_mesh_shader
Extension Type
Device extension
Registered Extension Number
203
Revision
1
Ratification Status
Not ratified
Extension and Version Dependencies
VK_KHR_get_physical_device_properties2 or Vulkan Version 1.1
API Interactions
  • Interacts with VK_VERSION_1_2
  • Interacts with VK_AMD_draw_indirect_count
  • Interacts with VK_EXT_device_generated_commands
  • Interacts with VK_KHR_draw_indirect_count
SPIR-V Dependencies
Contact

Other Extension Metadata

Last Modified Date
2018-07-19
Interactions and External Dependencies
Contributors
  • Pat Brown, NVIDIA
  • Jeff Bolz, NVIDIA
  • Daniel Koch, NVIDIA
  • Piers Daniell, NVIDIA
  • Pierre Boudier, NVIDIA

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.

There are new programmable shader types — the task and mesh shader — to generate these collections to be processed by fixed-function primitive assembly and rasterization logic. When task and mesh shaders are dispatched, they replace the core pre-rasterization stages, including vertex array attribute fetching, vertex shader processing, tessellation, and geometry shader processing.

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

New Commands

If Vulkan Version 1.2 or VK_KHR_draw_indirect_count or VK_AMD_draw_indirect_count is supported:

New Structures

New Enum Constants

If VK_EXT_device_generated_commands is supported:

New or Modified Built-In Variables

New SPIR-V Capability

Issues

  1. How to name this extension?

    RESOLVED: VK_NV_mesh_shader

    Other options considered:

    • VK_NV_mesh_shading
    • VK_NV_programmable_mesh_shading
    • VK_NV_primitive_group_shading
    • VK_NV_grouped_drawing
  1. Do we need a new VkPrimitiveTopology?

    RESOLVED: No. We skip the InputAssembler stage.

  2. Should we allow Instancing?

    RESOLVED: No. There is no fixed function input, other than the IDs. However, allow offsetting with a “first” value.

  3. Should we use existing vkCmdDraw or introduce new functions?

    RESOLVED: Introduce new functions.

    New functions make it easier to separate from “programmable primitive shading” chapter, less “dual use” language about existing functions having alternative behavior. The text around the existing “draws” is heavily based around emitting vertices.

  4. If new functions, how to name?

    RESOLVED: CmdDrawMeshTasks*

    Other options considered:

    • CmdDrawMeshed
    • CmdDrawTasked
    • CmdDrawGrouped
  5. Should VK_SHADER_STAGE_ALL_GRAPHICS be updated to include the new stages?

    RESOLVED: No. If an application were to be recompiled with headers that include additional shader stage bits in VK_SHADER_STAGE_ALL_GRAPHICS, then the previously valid application would no longer be valid on implementations that do not support mesh or task shaders. This means the change would not be backwards compatible. It is too bad VkShaderStageFlagBits does not have a dedicated “all supported graphics stages” bit like VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, which would have avoided this problem.

Version History

  • Revision 1, 2018-07-19 (Christoph Kubisch, Daniel Koch)

    • Internal revisions

See Also

No cross-references are available

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

cmdDrawMeshTasksNV Source #

Arguments

:: MonadIO io 
=> CommandBuffer

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

-> ("taskCount" ::: Word32)

taskCount is the number of local workgroups to dispatch in the X dimension. Y and Z dimension are implicitly set to one.

-> ("firstTask" ::: Word32)

firstTask is the X component of the first workgroup ID.

-> io () 

vkCmdDrawMeshTasksNV - Draw mesh task work items

Description

When the command is executed, a global workgroup consisting of taskCount 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 QUEUE_GRAPHICS_BIT operations
  • This command must only be called inside of a render pass instance
  • This command must not be called between suspended render pass instances
  • 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 VK_QUEUE_GRAPHICS_BIT Action

Conditional Rendering

vkCmdDrawMeshTasksNV is affected by conditional rendering

See Also

VK_NV_mesh_shader, CommandBuffer

cmdDrawMeshTasksIndirectNV Source #

Arguments

:: 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 () 

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

Description

cmdDrawMeshTasksIndirectNV behaves similarly to cmdDrawMeshTasksNV 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 DrawMeshTasksIndirectCommandNV 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 QUEUE_GRAPHICS_BIT operations
  • This command must only be called inside of a render pass instance
  • This command must not be called between suspended render pass instances
  • 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 VK_QUEUE_GRAPHICS_BIT Action

Conditional Rendering

vkCmdDrawMeshTasksIndirectNV is affected by conditional rendering

See Also

VK_NV_mesh_shader, Buffer, CommandBuffer, DeviceSize

cmdDrawMeshTasksIndirectCountNV Source #

Arguments

:: 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 () 

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

Description

cmdDrawMeshTasksIndirectCountNV behaves similarly to cmdDrawMeshTasksIndirectNV 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 QUEUE_GRAPHICS_BIT operations
  • This command must only be called inside of a render pass instance
  • This command must not be called between suspended render pass instances
  • 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 VK_QUEUE_GRAPHICS_BIT Action

Conditional Rendering

vkCmdDrawMeshTasksIndirectCountNV is affected by conditional rendering

See Also

VK_AMD_draw_indirect_count, VK_KHR_draw_indirect_count, VK_NV_mesh_shader, VK_VERSION_1_2, Buffer, CommandBuffer, DeviceSize

data PhysicalDeviceMeshShaderFeaturesNV Source #

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

Members

This structure describes the following features:

Description

If the PhysicalDeviceMeshShaderFeaturesNV 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. If the application wishes to use a Device with any features described by PhysicalDeviceMeshShaderFeaturesNV, it must add an instance of the structure, with the desired feature members set to TRUE, to the pNext chain of DeviceCreateInfo when creating the Device.

Valid Usage (Implicit)

See Also

VK_NV_mesh_shader, Bool32, StructureType

Constructors

PhysicalDeviceMeshShaderFeaturesNV 

Fields

Instances

Instances details
Eq PhysicalDeviceMeshShaderFeaturesNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_mesh_shader

Storable PhysicalDeviceMeshShaderFeaturesNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_mesh_shader

Show PhysicalDeviceMeshShaderFeaturesNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_mesh_shader

FromCStruct PhysicalDeviceMeshShaderFeaturesNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_mesh_shader

ToCStruct PhysicalDeviceMeshShaderFeaturesNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_mesh_shader

Zero PhysicalDeviceMeshShaderFeaturesNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_mesh_shader

data PhysicalDeviceMeshShaderPropertiesNV Source #

VkPhysicalDeviceMeshShaderPropertiesNV - Structure describing mesh shading properties

Description

If the PhysicalDeviceMeshShaderPropertiesNV structure is included in the pNext chain of the PhysicalDeviceProperties2 structure passed to getPhysicalDeviceProperties2, it is filled in with each corresponding implementation-dependent property.

Valid Usage (Implicit)

See Also

VK_NV_mesh_shader, StructureType

Constructors

PhysicalDeviceMeshShaderPropertiesNV 

Fields

  • maxDrawMeshTasksCount :: Word32

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

  • 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. 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.

  • maxTaskTotalMemorySize :: Word32

    maxTaskTotalMemorySize is the maximum number of bytes that the task shader can use in total for shared and output memory combined.

  • maxTaskOutputCount :: Word32

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

  • 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. 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.

  • maxMeshTotalMemorySize :: Word32

    maxMeshTotalMemorySize is the maximum number of bytes that the mesh shader can use in total for shared and output memory combined.

  • maxMeshOutputVertices :: Word32

    maxMeshOutputVertices is the maximum number of vertices a mesh shader output can store.

  • maxMeshOutputPrimitives :: Word32

    maxMeshOutputPrimitives is the maximum number of primitives a mesh shader output can store.

  • maxMeshMultiviewViewCount :: Word32

    maxMeshMultiviewViewCount is the maximum number of multiview views a mesh shader can use.

  • meshOutputPerVertexGranularity :: Word32

    meshOutputPerVertexGranularity is the granularity with which mesh vertex outputs are allocated. The value can be used to compute the memory size used by the mesh shader, which must be less than or equal to maxMeshTotalMemorySize.

  • meshOutputPerPrimitiveGranularity :: Word32

    meshOutputPerPrimitiveGranularity is the granularity with which mesh outputs qualified as per-primitive are allocated. The value can be used to compute the memory size used by the mesh shader, which must be less than or equal to maxMeshTotalMemorySize.

Instances

Instances details
Eq PhysicalDeviceMeshShaderPropertiesNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_mesh_shader

Storable PhysicalDeviceMeshShaderPropertiesNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_mesh_shader

Show PhysicalDeviceMeshShaderPropertiesNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_mesh_shader

FromCStruct PhysicalDeviceMeshShaderPropertiesNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_mesh_shader

ToCStruct PhysicalDeviceMeshShaderPropertiesNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_mesh_shader

Zero PhysicalDeviceMeshShaderPropertiesNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_mesh_shader

data DrawMeshTasksIndirectCommandNV Source #

VkDrawMeshTasksIndirectCommandNV - Structure specifying a mesh tasks draw indirect command

Description

The members of DrawMeshTasksIndirectCommandNV have the same meaning as the similarly named parameters of cmdDrawMeshTasksNV.

Valid Usage

See Also

VK_NV_mesh_shader, cmdDrawMeshTasksIndirectNV

Constructors

DrawMeshTasksIndirectCommandNV 

Fields

Instances

Instances details
Eq DrawMeshTasksIndirectCommandNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_mesh_shader

Storable DrawMeshTasksIndirectCommandNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_mesh_shader

Show DrawMeshTasksIndirectCommandNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_mesh_shader

FromCStruct DrawMeshTasksIndirectCommandNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_mesh_shader

ToCStruct DrawMeshTasksIndirectCommandNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_mesh_shader

Zero DrawMeshTasksIndirectCommandNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_mesh_shader

type NV_MESH_SHADER_EXTENSION_NAME = "VK_NV_mesh_shader" Source #

newtype IndirectCommandsTokenTypeEXT Source #

VkIndirectCommandsTokenTypeEXT - Enum specifying token commands

Description

'

Common TokensCommand Data
INDIRECT_COMMANDS_TOKEN_TYPE_EXECUTION_SET_EXTu32[] array of indices into the indirect execution set
INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_CONSTANT_EXTu32[] raw data
INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_DATA_EXTu8[] raw data
INDIRECT_COMMANDS_TOKEN_TYPE_SEQUENCE_INDEX_EXTu32 placeholder data (not accessed by shader)
INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_DATA_SEQUENCE_INDEX_EXTu32 placeholder data (not accessed by shader)
Compute Tokens
INDIRECT_COMMANDS_TOKEN_TYPE_DISPATCH_EXTDispatchIndirectCommand
Ray Tracing Tokens
INDIRECT_COMMANDS_TOKEN_TYPE_TRACE_RAYS2_EXTTraceRaysIndirectCommand2KHR
Graphics State Tokens
INDIRECT_COMMANDS_TOKEN_TYPE_INDEX_BUFFER_EXTBindIndexBufferIndirectCommandEXT
INDIRECT_COMMANDS_TOKEN_TYPE_VERTEX_BUFFER_EXTBindVertexBufferIndirectCommandEXT
Graphics Draw Tokens
INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_INDEXED_EXTDrawIndexedIndirectCommand
INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_EXTDrawIndirectCommand
INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_EXTDrawMeshTasksIndirectCommandEXT
INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_NV_EXTDrawMeshTasksIndirectCommandNV
Graphics Draw Count Tokens
INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_INDEXED_COUNT_EXTDrawIndirectCountIndirectCommandEXT with VkDrawIndexedIndirectCommand
INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_COUNT_EXTDrawIndirectCountIndirectCommandEXT with VkDrawIndirectCommand
INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_COUNT_EXTDrawIndirectCountIndirectCommandEXT with VkDrawMeshTasksIndirectCommandEXT
INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_COUNT_NV_EXTDrawIndirectCountIndirectCommandEXT with VkDrawMeshTasksIndirectCommandNV

Supported Indirect Command Tokens

See Also

VK_EXT_device_generated_commands, IndirectCommandsLayoutTokenEXT

Bundled Patterns

pattern INDIRECT_COMMANDS_TOKEN_TYPE_DISPATCH_EXT :: IndirectCommandsTokenTypeEXT 
pattern INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_COUNT_EXT :: IndirectCommandsTokenTypeEXT 
pattern INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_EXT :: IndirectCommandsTokenTypeEXT 
pattern INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_INDEXED_COUNT_EXT :: IndirectCommandsTokenTypeEXT 
pattern INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_INDEXED_EXT :: IndirectCommandsTokenTypeEXT 
pattern INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_COUNT_EXT :: IndirectCommandsTokenTypeEXT 
pattern INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_COUNT_NV_EXT :: IndirectCommandsTokenTypeEXT 
pattern INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_EXT :: IndirectCommandsTokenTypeEXT 
pattern INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_NV_EXT :: IndirectCommandsTokenTypeEXT 
pattern INDIRECT_COMMANDS_TOKEN_TYPE_EXECUTION_SET_EXT :: IndirectCommandsTokenTypeEXT 
pattern INDIRECT_COMMANDS_TOKEN_TYPE_INDEX_BUFFER_EXT :: IndirectCommandsTokenTypeEXT 
pattern INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_CONSTANT_EXT :: IndirectCommandsTokenTypeEXT 
pattern INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_DATA_EXT :: IndirectCommandsTokenTypeEXT 
pattern INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_DATA_SEQUENCE_INDEX_EXT :: IndirectCommandsTokenTypeEXT 
pattern INDIRECT_COMMANDS_TOKEN_TYPE_SEQUENCE_INDEX_EXT :: IndirectCommandsTokenTypeEXT 
pattern INDIRECT_COMMANDS_TOKEN_TYPE_TRACE_RAYS2_EXT :: IndirectCommandsTokenTypeEXT 
pattern INDIRECT_COMMANDS_TOKEN_TYPE_VERTEX_BUFFER_EXT :: IndirectCommandsTokenTypeEXT 

Instances

Instances details
Eq IndirectCommandsTokenTypeEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_device_generated_commands

Ord IndirectCommandsTokenTypeEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_device_generated_commands

Storable IndirectCommandsTokenTypeEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_device_generated_commands

Read IndirectCommandsTokenTypeEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_device_generated_commands

Show IndirectCommandsTokenTypeEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_device_generated_commands

Zero IndirectCommandsTokenTypeEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_device_generated_commands