@@ -294,6 +294,7 @@ Supported extensions
294294* SPV_KHR_shader_draw_parameters
295295* SPV_EXT_descriptor_indexing
296296* SPV_EXT_fragment_fully_covered
297+ * SPV_EXT_mesh_shader
297298* SPV_EXT_shader_stencil_support
298299* SPV_AMD_shader_early_and_late_fragment_tests
299300* SPV_AMD_shader_explicit_vertex_parameter
@@ -1522,13 +1523,15 @@ some system-value (SV) semantic strings will be translated into SPIR-V
15221523| +-------------+----------------------------------------+-----------------------+-----------------------------+
15231524| | DsIn | ``PrimitiveId `` | N/A | ``Tessellation `` |
15241525| +-------------+----------------------------------------+-----------------------+-----------------------------+
1525- | SV_PrimitiveID | GSIn | ``PrimitiveId `` | N/A | ``Geometry `` |
1526- | +-------------+----------------------------------------+-----------------------+-----------------------------+
1526+ | | GSIn | ``PrimitiveId `` | N/A | ``Geometry `` |
1527+ | SV_PrimitiveID +-------------+----------------------------------------+-----------------------+-----------------------------+
15271528| | GSOut | ``PrimitiveId `` | N/A | ``Geometry `` |
15281529| +-------------+----------------------------------------+-----------------------+-----------------------------+
15291530| | PSIn | ``PrimitiveId `` | N/A | ``Geometry `` |
15301531| +-------------+----------------------------------------+-----------------------+-----------------------------+
1531- | | MSOut | ``PrimitiveId `` | N/A | ``MeshShadingNV `` |
1532+ | | | | | ``MeshShadingNV `` |
1533+ | | MSOut | ``PrimitiveId `` | N/A | |
1534+ | | | | | ``MeshShadingEXT `` |
15321535+---------------------------+-------------+----------------------------------------+-----------------------+-----------------------------+
15331536| | PCOut | ``TessLevelOuter `` | N/A | ``Tessellation `` |
15341537| SV_TessFactor +-------------+----------------------------------------+-----------------------+-----------------------------+
@@ -1546,15 +1549,19 @@ some system-value (SV) semantic strings will be translated into SPIR-V
15461549+---------------------------+-------------+----------------------------------------+-----------------------+-----------------------------+
15471550| | GSOut | ``Layer `` | N/A | ``Geometry `` |
15481551| +-------------+----------------------------------------+-----------------------+-----------------------------+
1549- | SV_RenderTargetArrayIndex | PSIn | ``Layer `` | N/A | ``Geometry `` |
1550- | +-------------+----------------------------------------+-----------------------+-----------------------------+
1551- | | MSOut | ``Layer `` | N/A | ``MeshShadingNV `` |
1552+ | | PSIn | ``Layer `` | N/A | ``Geometry `` |
1553+ | SV_RenderTargetArrayIndex +-------------+----------------------------------------+-----------------------+-----------------------------+
1554+ | | | | | ``MeshShadingNV `` |
1555+ | | MSOut | ``Layer `` | N/A | |
1556+ | | | | | ``MeshShadingEXT `` |
15521557+---------------------------+-------------+----------------------------------------+-----------------------+-----------------------------+
15531558| | GSOut | ``ViewportIndex `` | N/A | ``MultiViewport `` |
15541559| +-------------+----------------------------------------+-----------------------+-----------------------------+
1555- | SV_ViewportArrayIndex | PSIn | ``ViewportIndex `` | N/A | ``MultiViewport `` |
1556- | +-------------+----------------------------------------+-----------------------+-----------------------------+
1557- | | MSOut | ``ViewportIndex `` | N/A | ``MeshShadingNV `` |
1560+ | | PSIn | ``ViewportIndex `` | N/A | ``MultiViewport `` |
1561+ | SV_ViewportArrayIndex +-------------+----------------------------------------+-----------------------+-----------------------------+
1562+ | | | | | ``MeshShadingNV `` |
1563+ | | MSOut | ``ViewportIndex `` | N/A | |
1564+ | | | | | ``MeshShadingEXT `` |
15581565+---------------------------+-------------+----------------------------------------+-----------------------+-----------------------------+
15591566| | PSIn | ``SampleMask `` | N/A | ``Shader `` |
15601567| SV_Coverage +-------------+----------------------------------------+-----------------------+-----------------------------+
@@ -1582,6 +1589,9 @@ some system-value (SV) semantic strings will be translated into SPIR-V
15821589| +-------------+----------------------------------------+-----------------------+-----------------------------+
15831590| | MSOut | ``PrimitiveShadingRateKHR `` | N/A | ``FragmentShadingRate `` |
15841591+---------------------------+-------------+----------------------------------------+-----------------------+-----------------------------+
1592+ | SV_CullPrimitive | MSOut | ``CullPrimitiveEXT `` | N/A | ``MeshShadingEXT `` |
1593+ +---------------------------+-------------+----------------------------------------+-----------------------+-----------------------------+
1594+
15851595
15861596For entities (function parameters, function return values, struct fields) with
15871597the above SV semantic strings attached, SPIR-V variables of the
@@ -3409,26 +3419,34 @@ shaders and are translated to SPIR-V execution modes according to the table belo
34093419
34103420.. table :: Mapping from HLSL attribute to SPIR-V execution mode
34113421
3412- +-------------------+--------------------+-------------------------+
3413- | HLSL Attribute | Value | SPIR-V Execution Mode |
3414- +===================+====================+=========================+
3415- | ``outputtopology`` | ``point `` | ``OutputPoints `` |
3416- | +--------------------+-------------------------+
3417- | ``(Mesh shader)`` | ``line `` | ``OutputLinesNV `` |
3418- | +--------------------+-------------------------+
3419- | | ``triangle `` | ``OutputTrianglesNV `` |
3420- +-------------------+--------------------+-------------------------+
3421- | ``numthreads `` | ``X, Y, Z `` | ``LocalSize X, Y, Z `` |
3422- | | | |
3423- | | ``(X*Y*Z <= 128) `` | |
3424- +-------------------+--------------------+-------------------------+
3422+ +-----------------------+--------------------+-------------------------+
3423+ | HLSL Attribute | Value | SPIR-V Execution Mode |
3424+ +=======================+====================+=========================+
3425+ | ``outputtopology`` | ``point `` | ``OutputPoints `` |
3426+ | +--------------------+-------------------------+
3427+ | (SPV_NV_mesh_shader) | ``line `` | ``OutputLinesNV `` |
3428+ | | | |
3429+ | +--------------------+-------------------------+
3430+ | | ``triangle `` | ``OutputTrianglesNV `` |
3431+ +-----------------------+--------------------+-------------------------+
3432+ | ``outputtopology`` | ``point `` | ``OutputPoints `` |
3433+ | +--------------------+-------------------------+
3434+ | (SPV_EXT_mesh_shader) | ``line `` | ``OutputLinesEXT `` |
3435+ | | | |
3436+ | +--------------------+-------------------------+
3437+ | | ``triangle `` | ``OutputTrianglesEXT `` |
3438+ +-----------------------+--------------------+-------------------------+
3439+ | ``numthreads `` | ``X, Y, Z `` | ``LocalSize X, Y, Z `` |
3440+ | | | |
3441+ | | ``(X*Y*Z <= 128) `` | |
3442+ +-----------------------+--------------------+-------------------------+
34253443
34263444Intrinsics
34273445~~~~~~~~~~
34283446The following HLSL intrinsics are used in Mesh or Amplification shaders
34293447and are translated to SPIR-V intrinsics according to the table below:
34303448
3431- .. table :: Mapping from HLSL intrinsics to SPIR-V intrinsics
3449+ .. table :: Mapping from HLSL intrinsics to SPIR-V intrinsics for SPV_NV_mesh_shader
34323450
34333451+---------------------------+--------------------+-----------------------------------------+
34343452| HLSL Intrinsic | Parameters | SPIR-V Intrinsic |
@@ -3446,6 +3464,24 @@ and are translated to SPIR-V intrinsics according to the table below:
34463464| | ``MeshPayload `` | |
34473465+---------------------------+--------------------+-----------------------------------------+
34483466
3467+ .. table :: Mapping from HLSL intrinsics to SPIR-V intrinsics for SPV_EXT_mesh_shader
3468+
3469+ +---------------------------+--------------------+--------------------------------------------------------------+
3470+ | HLSL Intrinsic | Parameters | SPIR-V Intrinsic |
3471+ +===========================+====================+==============================================================+
3472+ | ``SetMeshOutputCounts `` | ``numVertices `` | ``OpSetMeshOutputsEXT `` |
3473+ | | | |
3474+ | ``(Mesh shader) `` | ``numPrimitives `` | |
3475+ +---------------------------+--------------------+--------------------------------------------------------------+
3476+ | ``DispatchMesh `` | ``ThreadX `` | ``OpEmitMeshTasksEXT ThreadX ThreadY ThreadZ MeshPayload `` |
3477+ | | | |
3478+ | ``(Amplification shader)``| ``ThreadY `` | ``TaskCountNV ThreadX*ThreadY*ThreadZ `` |
3479+ | | | |
3480+ | | ``ThreadZ `` | |
3481+ | | | |
3482+ | | ``MeshPayload `` | |
3483+ +---------------------------+--------------------+--------------------------------------------------------------+
3484+
34493485| Note : For ``DispatchMesh`` intrinsic, we also emit ``MeshPayload`` as output block with ``PerTaskNV`` decoration
34503486
34513487Mesh Interface Variables
0 commit comments