Skip to content

Commit 4f3930a

Browse files
authored
Removing union, fix typos
1 parent e26ef18 commit 4f3930a

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

llvm/docs/DirectX/DXContainer.rst

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ FXC are marked with \*.
111111
#. `PSV0`_ - Stores Pipeline State Validation data.
112112
#. RDAT† - Stores Runtime Data.
113113
#. RDEF\* - Stores resource definitions.
114-
#. RTS0 - Stores compiled root signature.
114+
#. `RTS0`_ - Stores compiled root signature.
115115
#. `SFI0`_ - Stores shader feature flags.
116116
#. SHDR\* - Stores compiled DXBC bytecode.
117117
#. SHEX\* - Stores compiled DXBC bytecode.
@@ -402,9 +402,9 @@ This denotes which optional features the shader requires. The flag values are
402402
defined in `llvm/include/llvm/BinaryFormat/DXContainerConstants.def <https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/BinaryFormat/DXContainerConstants.def>`_.
403403

404404

405-
Root Signature (RST0) Part
406-
---------
407-
.. _RST0:
405+
Root Signature (RTS0) Part
406+
--------------------------
407+
.. _RTS0:
408408

409409
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.
410410

@@ -457,18 +457,25 @@ Each root parameter in the signature is preceded by a `RootParameterHeader` that
457457
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.
458458

459459
Root Parameters
460-
~~~~~~~~~~~~~~~~~~~~~~~
460+
~~~~~~~~~~~~~~~
461461

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``.
463463

464-
union RootParameter {
465-
RootConstants Constants;
466-
};
464+
Root Constants
465+
~~~~~~~~~~~~~~
466+
467+
.. code-block:: cpp
467468
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+
};
469474
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:
471476

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

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

Comments
 (0)