Skip to content

Commit 8dc983a

Browse files
authored
Update DXContainer.rst
1 parent 5303de8 commit 8dc983a

File tree

1 file changed

+45
-38
lines changed

1 file changed

+45
-38
lines changed

llvm/docs/DirectX/DXContainer.rst

Lines changed: 45 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,11 @@ This structure serves as a contract between the application and the GPU,
411411
establishing a layout for resource binding that both the shader compiler and
412412
the runtime can understand.
413413

414-
The Root Signature consists of a header followed by a collection of root parameters
415-
and static samplers. The structure uses a versioned design with offset-based references
416-
to allow for flexible serialization and deserialization.
414+
The Root Signature consists of a header followed by an array of root parameters
415+
and an array of static samplers. The structure uses a versioned design with
416+
offset-based references to allow for flexible serialization and deserialization.
417+
One consequence of using an offset-based reference is that root parameters and
418+
static samplers don't need to follow any specific ordering logic.
417419

418420
Root Signature Header
419421
~~~~~~~~~~~~~~~~~~~~~
@@ -445,8 +447,17 @@ The `RootSignatureHeader` structure contains the top-level information about a r
445447
This header allows readers to navigate the binary representation of the root signature by
446448
providing counts and offsets to locate each component within the serialized data.
447449

450+
Root Parameters
451+
~~~~~~~~~~~~~~~
452+
453+
Root signatures parameters are split into a header section containing the parameter type,
454+
shader visibility and its offset, and a data section. The parameters don't need to follow
455+
any specific order. Root parameters define the interface elements that shaders can access.
456+
Each parameter can be one of several types, including descriptor tables, constants, or
457+
descriptors for different resource types.
458+
448459
Root Parameter Header
449-
~~~~~~~~~~~~~~~~~~~~~
460+
'''''''''''''''''''''
450461

451462
.. code-block:: c
452463
@@ -470,17 +481,14 @@ the parameter's basic attributes:
470481
The header uses a parameter type field rather than encoding the version of the parameter through
471482
size, allowing for a more explicit representation of the parameter's nature.
472483

473-
Root Parameters
474-
~~~~~~~~~~~~~~~
475-
476-
The Root Parameters section contains structured definitions for each type of root parameter that can
477-
be included in a root signature. Each structure corresponds to a specific parameter type as identified
478-
by the ``ParameterType`` field in the ``RootParameterHeader``.
484+
Root Parameter Types
485+
''''''''''''''''''''
486+
This section describes the representation of each root parameter type.
479487

480488
Root Constants
481-
~~~~~~~~~~~~~~
489+
^^^^^^^^^^^^^^
482490

483-
.. code-block:: cpp
491+
.. code-block:: c
484492
485493
struct RootConstants {
486494
uint32_t ShaderRegister;
@@ -499,12 +507,12 @@ Root constants provide a fast way to pass small amounts of data directly to the
499507
overhead of creating and binding a constant buffer resource.
500508

501509
Root Descriptor
502-
~~~~~~~~~~~~~~~
510+
^^^^^^^^^^^^^^^
503511

504512
Root descriptors provide a mechanism for binding individual resources to shader stages in the Direct3D 12
505513
rendering pipeline. They allow applications to specify how shader stages access specific GPU resources.
506514

507-
.. code-block:: cpp
515+
.. code-block:: c
508516
509517
enum RootDescriptorFlags {
510518
None = 0,
@@ -532,25 +540,24 @@ performing further code optimizations. For details, check
532540
`Direct X documentation <https://learn.microsoft.com/en-us/windows/win32/direct3d12/root-signature-version-1-1#static-and-volatile-flags>`_.
533541

534542
Version 1.0 Root Descriptor
535-
'''''''''''''''''''''''''''
543+
"""""""""""""""""""""""""""
536544
The Version 1.0 RootDescriptor_V1_0 provides basic resource binding:
537545

538546
#. **ShaderRegister**: The shader register where the descriptor is bound.
539547
#. **RegisterSpace**: The register space used for the binding.
540548

541549
Version 1.1 Root Descriptor
542-
'''''''''''''''''''''''''''
550+
"""""""""""""""""""""""""""
543551
The Version 1.1 RootDescriptor_V1_1 extends the base structure with the following additional fields:
544552

545553
#. **Flags**: Provides additional metadata about the descriptor's usage pattern.
546554

547555
Root Descriptor Table
548-
~~~~~~~~~~~~~~~~~~~~~
549-
556+
^^^^^^^^^^^^^^^^^^^^^
550557
Descriptor tables function as containers that hold references to descriptors in descriptor heaps.
551558
They allow multiple descriptors to be bound to the pipeline through a single root signature parameter.
552559

553-
.. code-block:: cpp
560+
.. code-block:: c
554561
555562
struct DescriptorRange_V1_0 {
556563
dxbc::DescriptorRangeType RangeType;
@@ -588,7 +595,7 @@ They allow multiple descriptors to be bound to the pipeline through a single roo
588595
589596
590597
Descriptor Range Version 1.0
591-
''''''''''''''''''''''''''''
598+
""""""""""""""""""""""""""""
592599
The Version 1.0 ``DescriptorRange_V1_0`` provides basic descriptor range definition:
593600

594601
#. **RangeType**: Type of descriptors (CBV, SRV, UAV, or Sampler)
@@ -598,14 +605,14 @@ The Version 1.0 ``DescriptorRange_V1_0`` provides basic descriptor range definit
598605
#. **OffsetInDescriptorsFromTableStart**: Offset from the descriptor heap start
599606

600607
Descriptor Range Version 1.1
601-
''''''''''''''''''''''''''''
608+
""""""""""""""""""""""""""""
602609
The Version 1.1 DescriptorRange_V1_1 extends the base structure with performance optimization flags.
603610

604611
#. **Flags**: Provide additional information about the descriptors and enable further driver optimizations.
605612
For details, check `Direct X documentation <https://learn.microsoft.com/en-us/windows/win32/direct3d12/root-signature-version-1-1#static-and-volatile-flags>`_.
606613

607-
Root Descriptor Table
608-
'''''''''''''''''''''
614+
Root Descriptor Table Structure
615+
"""""""""""""""""""""""""""""""
609616
RootDescriptorTable provides basic table structure:
610617

611618
#. **NumDescriptorRanges**: Number of descriptor ranges
@@ -616,7 +623,7 @@ Static Samplers
616623

617624
Static samplers provide a way to define fixed sampler states within the root signature itself.
618625

619-
.. code-block:: cpp
626+
.. code-block:: c
620627
621628
struct StaticSamplerDesc {
622629
FilterMode Filter;
@@ -637,21 +644,21 @@ Static samplers provide a way to define fixed sampler states within the root sig
637644
638645
The StaticSamplerDesc structure defines all properties of a static sampler:
639646

640-
#. Filter: The filtering mode (e.g., point, linear, anisotropic) used for texture sampling.
647+
#. **Filter**: The filtering mode (e.g., point, linear, anisotropic) used for texture sampling.
641648
For details, check `Static Sampler Fileters definition. <https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ne-d3d12-d3d12_filter#syntax>`_.
642-
#. AddressU: The addressing mode for the U texture coordinate.
649+
#. **AddressU**: The addressing mode for the U texture coordinate.
643650
For details, check `Texture address mode definition. <https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ne-d3d12-d3d12_texture_address_mode>`_.
644-
#. AddressV: The addressing mode for the V texture coordinate.
645-
#. AddressW: The addressing mode for the W texture coordinate.
646-
#. MipLODBias: Bias value applied to mipmap level of detail calculations.
647-
#. MaxAnisotropy: Maximum anisotropy level when using anisotropic filtering.
648-
#. ComparisonFunc: Comparison function used for comparison samplers.
651+
#. **AddressV**: The addressing mode for the V texture coordinate.
652+
#. **AddressW**: The addressing mode for the W texture coordinate.
653+
#. **MipLODBias**: Bias value applied to mipmap level of detail calculations.
654+
#. **MaxAnisotropy**: Maximum anisotropy level when using anisotropic filtering.
655+
#. **ComparisonFunc**: Comparison function used for comparison samplers.
649656
For details, check `Comparison Function definition. <https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ne-d3d12-d3d12_comparison_func>`_.
650-
#. BorderColor: Predefined border color used when address mode is set to border.
657+
#. **BorderColor**: Predefined border color used when address mode is set to border.
651658
For details, check `Static border color <https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ne-d3d12-d3d12_static_border_color>`_.
652-
#. MinLOD: Minimum level of detail to use for sampling.
653-
#. MaxLOD: Maximum level of detail to use for sampling.
654-
#. ShaderRegister: The shader sampler register (s#) where this sampler is bound.
655-
#. RegisterSpace: The register space used for the binding.
656-
#. ShaderVisibility: Specifies which shader stages can access this sampler.
657-
For details, check `Sahder Visibility definition. <https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ne-d3d12-d3d12_shader_visibility>`_.
659+
#. **MinLOD**: Minimum level of detail to use for sampling.
660+
#. **MaxLOD**: Maximum level of detail to use for sampling.
661+
#. **ShaderRegister**: The shader sampler register (s#) where this sampler is bound.
662+
#. **RegisterSpace**: The register space used for the binding.
663+
#. **ShaderVisibility**: Specifies which shader stages can access this sampler.
664+
For details, check `Shader Visibility definition. <https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ne-d3d12-d3d12_shader_visibility>`_.

0 commit comments

Comments
 (0)