|
@@ -753,117 +753,119 @@ some system-value (SV) semantic strings will be translated into SPIR-V
|
|
|
|
|
|
.. table:: Mapping from HLSL SV semantic to SPIR-V builtin and execution mode
|
|
|
|
|
|
-+---------------------------+-------------+--------------------------+-----------------------+
|
|
|
-| HLSL Semantic | SigPoint | SPIR-V ``BuiltIn`` | SPIR-V Execution Mode |
|
|
|
-+===========================+=============+==========================+=======================+
|
|
|
-| | VSOut | ``Position`` | N/A |
|
|
|
-| +-------------+--------------------------+-----------------------+
|
|
|
-| | HSCPIn | ``Position`` | N/A |
|
|
|
-| +-------------+--------------------------+-----------------------+
|
|
|
-| | HSCPOut | ``Position`` | N/A |
|
|
|
-| +-------------+--------------------------+-----------------------+
|
|
|
-| | DSCPIn | ``Position`` | N/A |
|
|
|
-| SV_Position +-------------+--------------------------+-----------------------+
|
|
|
-| | DSOut | ``Position`` | N/A |
|
|
|
-| +-------------+--------------------------+-----------------------+
|
|
|
-| | GSVIn | ``Position`` | N/A |
|
|
|
-| +-------------+--------------------------+-----------------------+
|
|
|
-| | GSOut | ``Position`` | N/A |
|
|
|
-| +-------------+--------------------------+-----------------------+
|
|
|
-| | PSIn | ``FragCoord`` | N/A |
|
|
|
-+---------------------------+-------------+--------------------------+-----------------------+
|
|
|
-| | VSOut | ``ClipDistance`` | N/A |
|
|
|
-| +-------------+--------------------------+-----------------------+
|
|
|
-| | HSCPIn | ``ClipDistance`` | N/A |
|
|
|
-| +-------------+--------------------------+-----------------------+
|
|
|
-| | HSCPOut | ``ClipDistance`` | N/A |
|
|
|
-| +-------------+--------------------------+-----------------------+
|
|
|
-| | DSCPIn | ``ClipDistance`` | N/A |
|
|
|
-| SV_ClipDistance +-------------+--------------------------+-----------------------+
|
|
|
-| | DSOut | ``ClipDistance`` | N/A |
|
|
|
-| +-------------+--------------------------+-----------------------+
|
|
|
-| | GSVIn | ``ClipDistance`` | N/A |
|
|
|
-| +-------------+--------------------------+-----------------------+
|
|
|
-| | GSOut | ``ClipDistance`` | N/A |
|
|
|
-| +-------------+--------------------------+-----------------------+
|
|
|
-| | PSIn | ``ClipDistance`` | N/A |
|
|
|
-+---------------------------+-------------+--------------------------+-----------------------+
|
|
|
-| | VSOut | ``CullDistance`` | N/A |
|
|
|
-| +-------------+--------------------------+-----------------------+
|
|
|
-| | HSCPIn | ``CullDistance`` | N/A |
|
|
|
-| +-------------+--------------------------+-----------------------+
|
|
|
-| | HSCPOut | ``CullDistance`` | N/A |
|
|
|
-| +-------------+--------------------------+-----------------------+
|
|
|
-| | DSCPIn | ``CullDistance`` | N/A |
|
|
|
-| SV_CullDistance +-------------+--------------------------+-----------------------+
|
|
|
-| | DSOut | ``CullDistance`` | N/A |
|
|
|
-| +-------------+--------------------------+-----------------------+
|
|
|
-| | GSVIn | ``CullDistance`` | N/A |
|
|
|
-| +-------------+--------------------------+-----------------------+
|
|
|
-| | GSOut | ``CullDistance`` | N/A |
|
|
|
-| +-------------+--------------------------+-----------------------+
|
|
|
-| | PSIn | ``CullDistance`` | N/A |
|
|
|
-+---------------------------+-------------+--------------------------+-----------------------+
|
|
|
-| SV_VertexID | VSIn | ``VertexIndex`` | N/A |
|
|
|
-+---------------------------+-------------+--------------------------+-----------------------+
|
|
|
-| SV_InstanceID | VSIn | ``InstanceIndex`` | N/A |
|
|
|
-+---------------------------+-------------+--------------------------+-----------------------+
|
|
|
-| SV_Depth | PSOut | ``FragDepth`` | N/A |
|
|
|
-+---------------------------+-------------+--------------------------+-----------------------+
|
|
|
-| SV_DepthGreaterEqual | PSOut | ``FragDepth`` | ``DepthGreater`` |
|
|
|
-+---------------------------+-------------+--------------------------+-----------------------+
|
|
|
-| SV_DepthLessEqual | PSOut | ``FragDepth`` | ``DepthLess`` |
|
|
|
-+---------------------------+-------------+--------------------------+-----------------------+
|
|
|
-| SV_IsFrontFace | PSIn | ``FrontFacing`` | N/A |
|
|
|
-+---------------------------+-------------+--------------------------+-----------------------+
|
|
|
-| SV_DispatchThreadID | CSIn | ``GlobalInvocationId`` | N/A |
|
|
|
-+---------------------------+-------------+--------------------------+-----------------------+
|
|
|
-| SV_GroupID | CSIn | ``WorkgroupId`` | N/A |
|
|
|
-+---------------------------+-------------+--------------------------+-----------------------+
|
|
|
-| SV_GroupThreadID | CSIn | ``LocalInvocationId`` | N/A |
|
|
|
-+---------------------------+-------------+--------------------------+-----------------------+
|
|
|
-| SV_GroupIndex | CSIn | ``LocalInvocationIndex`` | N/A |
|
|
|
-+---------------------------+-------------+--------------------------+-----------------------+
|
|
|
-| SV_OutputControlPointID | HSIn | ``InvocationId`` | N/A |
|
|
|
-+---------------------------+-------------+--------------------------+-----------------------+
|
|
|
-| SV_GSInstanceID | GSIn | ``InvocationId`` | N/A |
|
|
|
-+---------------------------+-------------+--------------------------+-----------------------+
|
|
|
-| SV_DomainLocation | DSIn | ``TessCoord`` | N/A |
|
|
|
-+---------------------------+-------------+--------------------------+-----------------------+
|
|
|
-| | HSIn | ``PrimitiveId`` | N/A |
|
|
|
-| +-------------+--------------------------+-----------------------+
|
|
|
-| | PCIn | ``PrimitiveId`` | N/A |
|
|
|
-| +-------------+--------------------------+-----------------------+
|
|
|
-| | DsIn | ``PrimitiveId`` | N/A |
|
|
|
-| SV_PrimitiveID +-------------+--------------------------+-----------------------+
|
|
|
-| | GSIn | ``PrimitiveId`` | N/A |
|
|
|
-| +-------------+--------------------------+-----------------------+
|
|
|
-| | GSOut | ``PrimitiveId`` | N/A |
|
|
|
-| +-------------+--------------------------+-----------------------+
|
|
|
-| | PSIn | ``PrimitiveId`` | N/A |
|
|
|
-+---------------------------+-------------+--------------------------+-----------------------+
|
|
|
-| | PCOut | ``TessLevelOuter`` | N/A |
|
|
|
-| SV_TessFactor +-------------+--------------------------+-----------------------+
|
|
|
-| | DSIn | ``TessLevelOuter`` | N/A |
|
|
|
-+---------------------------+-------------+--------------------------+-----------------------+
|
|
|
-| | PCOut | ``TessLevelInner`` | N/A |
|
|
|
-| SV_InsideTessFactor +-------------+--------------------------+-----------------------+
|
|
|
-| | DSIn | ``TessLevelInner`` | N/A |
|
|
|
-+---------------------------+-------------+--------------------------+-----------------------+
|
|
|
-| SV_SampleIndex | PSIn | ``SampleId`` | N/A |
|
|
|
-+---------------------------+-------------+--------------------------+-----------------------+
|
|
|
-| SV_StencilRef | PSOut | ``FragStencilRefEXT`` | N/A |
|
|
|
-+---------------------------+-------------+--------------------------+-----------------------+
|
|
|
-| | GSOut | ``Layer`` | N/A |
|
|
|
-| SV_RenderTargetArrayIndex +-------------+--------------------------+-----------------------+
|
|
|
-| | PSIn | ``Layer`` | N/A |
|
|
|
-+---------------------------+-------------+--------------------------+-----------------------+
|
|
|
-| | GSOut | ``ViewportIndex`` | N/A |
|
|
|
-| SV_ViewportArrayIndex +-------------+--------------------------+-----------------------+
|
|
|
-| | PSIn | ``ViewportIndex`` | N/A |
|
|
|
-+---------------------------+-------------+--------------------------+-----------------------+
|
|
|
-
|
|
|
-[TODO] add other SV semantic strings in the above
|
|
|
++---------------------------+-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| HLSL Semantic | SigPoint | SPIR-V ``BuiltIn`` | SPIR-V Execution Mode | SPIR-V Capability |
|
|
|
++===========================+=============+==========================+=======================+=======================+
|
|
|
+| | VSOut | ``Position`` | N/A | ``Shader`` |
|
|
|
+| +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | HSCPIn | ``Position`` | N/A | ``Shader`` |
|
|
|
+| +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | HSCPOut | ``Position`` | N/A | ``Shader`` |
|
|
|
+| +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | DSCPIn | ``Position`` | N/A | ``Shader`` |
|
|
|
+| SV_Position +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | DSOut | ``Position`` | N/A | ``Shader`` |
|
|
|
+| +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | GSVIn | ``Position`` | N/A | ``Shader`` |
|
|
|
+| +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | GSOut | ``Position`` | N/A | ``Shader`` |
|
|
|
+| +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | PSIn | ``FragCoord`` | N/A | ``Shader`` |
|
|
|
++---------------------------+-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | VSOut | ``ClipDistance`` | N/A | ``ClipDistance`` |
|
|
|
+| +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | HSCPIn | ``ClipDistance`` | N/A | ``ClipDistance`` |
|
|
|
+| +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | HSCPOut | ``ClipDistance`` | N/A | ``ClipDistance`` |
|
|
|
+| +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | DSCPIn | ``ClipDistance`` | N/A | ``ClipDistance`` |
|
|
|
+| SV_ClipDistance +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | DSOut | ``ClipDistance`` | N/A | ``ClipDistance`` |
|
|
|
+| +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | GSVIn | ``ClipDistance`` | N/A | ``ClipDistance`` |
|
|
|
+| +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | GSOut | ``ClipDistance`` | N/A | ``ClipDistance`` |
|
|
|
+| +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | PSIn | ``ClipDistance`` | N/A | ``ClipDistance`` |
|
|
|
++---------------------------+-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | VSOut | ``CullDistance`` | N/A | ``CullDistance`` |
|
|
|
+| +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | HSCPIn | ``CullDistance`` | N/A | ``CullDistance`` |
|
|
|
+| +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | HSCPOut | ``CullDistance`` | N/A | ``CullDistance`` |
|
|
|
+| +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | DSCPIn | ``CullDistance`` | N/A | ``CullDistance`` |
|
|
|
+| SV_CullDistance +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | DSOut | ``CullDistance`` | N/A | ``CullDistance`` |
|
|
|
+| +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | GSVIn | ``CullDistance`` | N/A | ``CullDistance`` |
|
|
|
+| +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | GSOut | ``CullDistance`` | N/A | ``CullDistance`` |
|
|
|
+| +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | PSIn | ``CullDistance`` | N/A | ``CullDistance`` |
|
|
|
++---------------------------+-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| SV_VertexID | VSIn | ``VertexIndex`` | N/A | ``Shader`` |
|
|
|
++---------------------------+-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| SV_InstanceID | VSIn | ``InstanceIndex`` | N/A | ``Shader`` |
|
|
|
++---------------------------+-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| SV_Depth | PSOut | ``FragDepth`` | N/A | ``Shader`` |
|
|
|
++---------------------------+-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| SV_DepthGreaterEqual | PSOut | ``FragDepth`` | ``DepthGreater`` | ``Shader`` |
|
|
|
++---------------------------+-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| SV_DepthLessEqual | PSOut | ``FragDepth`` | ``DepthLess`` | ``Shader`` |
|
|
|
++---------------------------+-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| SV_IsFrontFace | PSIn | ``FrontFacing`` | N/A | ``Shader`` |
|
|
|
++---------------------------+-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| SV_DispatchThreadID | CSIn | ``GlobalInvocationId`` | N/A | ``Shader`` |
|
|
|
++---------------------------+-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| SV_GroupID | CSIn | ``WorkgroupId`` | N/A | ``Shader`` |
|
|
|
++---------------------------+-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| SV_GroupThreadID | CSIn | ``LocalInvocationId`` | N/A | ``Shader`` |
|
|
|
++---------------------------+-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| SV_GroupIndex | CSIn | ``LocalInvocationIndex`` | N/A | ``Shader`` |
|
|
|
++---------------------------+-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| SV_OutputControlPointID | HSIn | ``InvocationId`` | N/A | ``Tessellation`` |
|
|
|
++---------------------------+-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| SV_GSInstanceID | GSIn | ``InvocationId`` | N/A | ``Geometry`` |
|
|
|
++---------------------------+-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| SV_DomainLocation | DSIn | ``TessCoord`` | N/A | ``Tessellation`` |
|
|
|
++---------------------------+-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | HSIn | ``PrimitiveId`` | N/A | ``Tessellation`` |
|
|
|
+| +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | PCIn | ``PrimitiveId`` | N/A | ``Tessellation`` |
|
|
|
+| +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | DsIn | ``PrimitiveId`` | N/A | ``Tessellation`` |
|
|
|
+| SV_PrimitiveID +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | GSIn | ``PrimitiveId`` | N/A | ``Geometry`` |
|
|
|
+| +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | GSOut | ``PrimitiveId`` | N/A | ``Geometry`` |
|
|
|
+| +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | PSIn | ``PrimitiveId`` | N/A | ``Geometry`` |
|
|
|
++---------------------------+-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | PCOut | ``TessLevelOuter`` | N/A | ``Tessellation`` |
|
|
|
+| SV_TessFactor +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | DSIn | ``TessLevelOuter`` | N/A | ``Tessellation`` |
|
|
|
++---------------------------+-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | PCOut | ``TessLevelInner`` | N/A | ``Tessellation`` |
|
|
|
+| SV_InsideTessFactor +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | DSIn | ``TessLevelInner`` | N/A | ``Tessellation`` |
|
|
|
++---------------------------+-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| SV_SampleIndex | PSIn | ``SampleId`` | N/A | ``SampleRateShading`` |
|
|
|
++---------------------------+-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| SV_StencilRef | PSOut | ``FragStencilRefEXT`` | N/A | ``StencilExportEXT`` |
|
|
|
++---------------------------+-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | GSOut | ``Layer`` | N/A | ``Geometry`` |
|
|
|
+| SV_RenderTargetArrayIndex +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | PSIn | ``Layer`` | N/A | ``Geometry`` |
|
|
|
++---------------------------+-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | GSOut | ``ViewportIndex`` | N/A | ``MultiViewport`` |
|
|
|
+| SV_ViewportArrayIndex +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | PSIn | ``ViewportIndex`` | N/A | ``MultiViewport`` |
|
|
|
++---------------------------+-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | PSIn | ``SampleMask`` | N/A | ``Shader`` |
|
|
|
+| SV_Coverage +-------------+--------------------------+-----------------------+-----------------------+
|
|
|
+| | PSOut | ``SampleMask`` | N/A | ``Shader`` |
|
|
|
++---------------------------+-------------+--------------------------+-----------------------+-----------------------+
|
|
|
|
|
|
For entities (function parameters, function return values, struct fields) with
|
|
|
the above SV semantic strings attached, SPIR-V variables of the
|