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
Copy file name to clipboardExpand all lines: llvm/docs/DirectX/DXContainer.rst
+20-13Lines changed: 20 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -111,7 +111,7 @@ FXC are marked with \*.
111
111
#. `PSV0`_ - Stores Pipeline State Validation data.
112
112
#. RDAT† - Stores Runtime Data.
113
113
#. RDEF\* - Stores resource definitions.
114
-
#. RTS0 - Stores compiled root signature.
114
+
#. `RTS0`_ - Stores compiled root signature.
115
115
#. `SFI0`_ - Stores shader feature flags.
116
116
#. SHDR\* - Stores compiled DXBC bytecode.
117
117
#. SHEX\* - Stores compiled DXBC bytecode.
@@ -402,9 +402,9 @@ This denotes which optional features the shader requires. The flag values are
402
402
defined in `llvm/include/llvm/BinaryFormat/DXContainerConstants.def <https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/BinaryFormat/DXContainerConstants.def>`_.
403
403
404
404
405
-
Root Signature (RST0) Part
406
-
---------
407
-
.. _RST0:
405
+
Root Signature (RTS0) Part
406
+
--------------------------
407
+
.. _RTS0:
408
408
409
409
The Root Signature defines the interface between the shader and the pipeline, specifying which resources are bound to the shader and how they are accessed. This structure serves as a contract between the application and the GPU, establishing a layout for resource binding that both the shader compiler and the runtime can understand.
410
410
@@ -457,18 +457,25 @@ Each root parameter in the signature is preceded by a `RootParameterHeader` that
457
457
The header uses a parameter type field rather than encoding the version of the parameter through size, allowing for a more explicit representation of the parameter's nature.
458
458
459
459
Root Parameters
460
-
~~~~~~~~~~~~~~~~~~~~~~~
460
+
~~~~~~~~~~~~~~~
461
461
462
-
.. code-block:: c
462
+
The Root Parameters section contains structured definitions for each type of root parameter that can be included in a root signature. Each structure corresponds to a specific parameter type as identified by the ``ParameterType`` field in the ``RootParameterHeader``.
463
463
464
-
union RootParameter {
465
-
RootConstants Constants;
466
-
};
464
+
Root Constants
465
+
~~~~~~~~~~~~~~
466
+
467
+
.. code-block:: cpp
467
468
468
-
The `RootParameter` union represents the various types of parameters that can be specified in a root signature. Such includes:
469
+
struct RootConstants {
470
+
uint32_t ShaderRegister;
471
+
uint32_t RegisterSpace;
472
+
uint32_t Num32BitValues;
473
+
};
469
474
470
-
- **Constants**: Represents inline root constants that are directly embedded in the root signature and passed to the shader without requiring a constant buffer resource.
475
+
The ``RootConstants`` structure represents inline root constants that are directly embedded in the root signature and passed to the shader without requiring a constant buffer resource:
471
476
472
-
Each specific parameter type will have its own structure with fields relevant to that parameter type. For example, `RootConstants` would include information about the register binding, count of 32-bit values, and other properties specific to constant parameters.
477
+
- **ShaderRegister**: The shader register (b#) where these constants are bound.
478
+
- **RegisterSpace**: The register space used for the binding.
479
+
- **Num32BitValues**: The number of 32-bit values included in this constant buffer.
473
480
474
-
When processing root parameters, readers should first check the `ParameterType` field in the corresponding header to determine which member of the union to access.
481
+
Root constants provide a fast way to pass small amounts of data directly to the shader without the overhead of creating and binding a constant buffer resource.
0 commit comments