You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[NFC][Doc] Update HLSL to SPIR-V document (microsoft#7204)
This is all about updating urls and tables in docs/SPIR-V.rst. I'm
currently working on a demo & tutorial about how to work with
Vulkan+HLSL+dxc toolchain so I made this PR. Thanks a lot for your
contribution to the ecosystem, and glad to see your feedback!
Signed-off-by: lumina37 <starry.qvq@gmail.com>
``-fspv-target-env=`` accepts a Vulkan target environment (see ``-help`` for
447
447
supported values). If such an option is not given, the CodeGen defaults to
448
448
``vulkan1.0``. When targeting ``vulkan1.0``, trying to use features that are only
449
-
available in Vulkan 1.1 (SPIR-V 1.3), like `Shader Model 6.0 wave intrinsics`_,
449
+
available in Vulkan 1.1 (SPIR-V 1.3), like `Shader Model 6.0 wave intrinsic <https://github.com/microsoft/directxshadercompiler/wiki/wave-intrinsics>`_,
450
450
will trigger a compiler error.
451
451
452
452
If ``-fspv-extension=`` is not specified, the CodeGen will select suitable
@@ -494,7 +494,7 @@ Specifically, we need to legalize the following HLSL source code patterns:
494
494
Legalization transformations will not run unless the above patterns are
495
495
encountered in the source code.
496
496
497
-
For more details, please see the `SPIR-V cookbook <https://github.com/Microsoft/DirectXShaderCompiler/tree/master/docs/SPIRV-Cookbook.rst>`_,
497
+
For more details, please see the `SPIR-V cookbook <https://github.com/Microsoft/DirectXShaderCompiler/tree/main/docs/SPIRV-Cookbook.rst>`_,
498
498
which contains examples of what HLSL code patterns will be accepted and
499
499
generate valid SPIR-V for Vulkan.
500
500
@@ -561,7 +561,7 @@ So if you want to run loop unrolling additionally after the default optimization
561
561
recipe, you can specify ``-Oconfig=-O,--loop-unroll``.
562
562
563
563
For the whole list of accepted passes and details about each one, please see
564
-
``spirv-opt``'s help manual (``spirv-opt --help``), or the SPIRV-Tools `optimizer header file <https://github.com/KhronosGroup/SPIRV-Tools/blob/master/include/spirv-tools/optimizer.hpp>`_.
564
+
``spirv-opt``'s help manual (``spirv-opt --help``), or the SPIRV-Tools `optimizer header file <https://github.com/KhronosGroup/SPIRV-Tools/blob/main/include/spirv-tools/optimizer.hpp>`_.
565
565
566
566
Validation
567
567
~~~~~~~~~~
@@ -640,7 +640,7 @@ HLSL Semantic
640
640
641
641
HLSL semantic strings are by default not emitted into the SPIR-V binary module.
642
642
If you need them, by specifying ``-fspv-reflect``, the compiler will use
643
-
the ``Op*DecorateStringGOOGLE`` instruction in `SPV_GOOGLE_hlsl_funtionality1 <https://github.com/KhronosGroup/SPIRV-Registry/blob/master/extensions/GOOGLE/SPV_GOOGLE_hlsl_functionality1.asciidoc>`_
643
+
the ``Op*DecorateStringGOOGLE`` instruction in `SPV_GOOGLE_hlsl_funtionality1 <https://github.com/KhronosGroup/SPIRV-Registry/blob/main/extensions/GOOGLE/SPV_GOOGLE_hlsl_functionality1.asciidoc>`_
644
644
extension to emit them.
645
645
646
646
HLSL User Types
@@ -661,7 +661,7 @@ Counter buffers for RW/Append/Consume StructuredBuffer
661
661
The association between a counter buffer and its main RW/Append/Consume
662
662
StructuredBuffer is conveyed by ``OpDecorateId <structured-buffer-id>
663
663
HLSLCounterBufferGOOGLE <counter-buffer-id>`` instruction from the
extension. This information is by default missing; you need to specify
666
666
``-fspv-reflect`` to direct the compiler to emit them.
667
667
@@ -911,7 +911,7 @@ For example,
911
911
912
912
RWTexture2D<float2> Tex2; // Works like before
913
913
914
-
``rgba8`` means ``Rgba8`` `SPIR-V Image Format <https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_image_format_a_image_format>`_.
914
+
``rgba8`` means ``Rgba8`` `SPIR-V Image Format <https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#Image_Format>`_.
915
915
The following table lists the mapping between ``FORMAT`` of
916
916
``[[vk::image_format("FORMAT")]]`` and its corresponding SPIR-V Image Format.
917
917
@@ -994,7 +994,7 @@ Please see the following sections for the details of each type. As a summary:
1. Vector-relaxed OpenGL ``std140`` for uniform buffers and vector-relaxed
1006
1006
OpenGL ``std430`` for storage buffers: these rules satisfy Vulkan `"Standard
1007
-
Uniform Buffer Layout" and "Standard Storage Buffer Layout" <https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#interfaces-resources-layout>`_,
1007
+
Uniform Buffer Layout" and "Standard Storage Buffer Layout" <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#interfaces-resources-layout>`_,
1008
1008
respectively.
1009
1009
They are the default.
1010
1010
2. DirectX memory layout rules for uniform buffers and storage buffers:
@@ -1027,7 +1027,7 @@ In the above, "vector-relaxed OpenGL ``std140``/``std430``" rules mean OpenGL
1027
1027
alignment:
1028
1028
1029
1029
1. The alignment of a vector type is set to be the alignment of its element type
1030
-
2. If the above causes an `improper straddle <https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#interfaces-resources-layout>`_,
1030
+
2. If the above causes an `improper straddle <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#interfaces-resources-layout>`_,
1031
1031
the alignment will be set to 16 bytes.
1032
1032
1033
1033
As an exmaple, for the following HLSL definition:
@@ -1471,7 +1471,7 @@ Without hints from the developer, the compiler will try its best to map
1471
1471
semantics to ``Location`` numbers. However, there is no single rule for this
1472
1472
mapping; semantic strings should be handled case by case.
1473
1473
1474
-
Firstly, under certain `SigPoints <https://github.com/Microsoft/DirectXShaderCompiler/blob/master/docs/DXIL.rst#hlsl-signatures-and-semantics>`_,
1474
+
Firstly, under certain `SigPoints <https://github.com/Microsoft/DirectXShaderCompiler/blob/main/docs/DXIL.rst#hlsl-signatures-and-semantics>`_,
1475
1475
some system-value (SV) semantic strings will be translated into SPIR-V
1476
1476
``BuiltIn`` decorations:
1477
1477
@@ -1655,7 +1655,7 @@ some system-value (SV) semantic strings will be translated into SPIR-V
@@ -4081,7 +4081,7 @@ This intrinsic funcion has the following signature:
4081
4081
4082
4082
uint64_t ReadClock(in uint scope);
4083
4083
4084
-
It translates to performing ``OpReadClockKHR`` defined in `VK_KHR_shader_clock <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_KHR_shader_clock.html>`_.
4084
+
It translates to performing ``OpReadClockKHR`` defined in `VK_KHR_shader_clock <https://registry.khronos.org/vulkan/specs/latest/man/html/VK_KHR_shader_clock.html>`_.
4085
4085
One can use the predefined scopes in the ``vk`` namepsace to specify the scope argument.
4086
4086
For example:
4087
4087
@@ -4091,11 +4091,11 @@ For example:
4091
4091
4092
4092
RawBufferLoad and RawBufferStore
4093
4093
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4094
-
The Vulkan extension `VK_KHR_buffer_device_address <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_KHR_buffer_device_address.html>`_
4094
+
The Vulkan extension `VK_KHR_buffer_device_address <https://registry.khronos.org/vulkan/specs/latest/man/html/VK_KHR_buffer_device_address.html>`_
4095
4095
supports getting the 64-bit address of a buffer and passing it to SPIR-V as a
4096
4096
Uniform buffer. SPIR-V can use the address to load and store data without a descriptor.
4097
4097
We add the following intrinsic functions to expose a subset of the
and `SPV_KHR_physical_storage_buffer <https://github.com/KhronosGroup/SPIRV-Registry/blob/main/extensions/KHR/SPV_KHR_physical_storage_buffer.asciidoc>`_
0 commit comments