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
+45-38Lines changed: 45 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -411,9 +411,11 @@ This structure serves as a contract between the application and the GPU,
411
411
establishing a layout for resource binding that both the shader compiler and
412
412
the runtime can understand.
413
413
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.
417
419
418
420
Root Signature Header
419
421
~~~~~~~~~~~~~~~~~~~~~
@@ -445,8 +447,17 @@ The `RootSignatureHeader` structure contains the top-level information about a r
445
447
This header allows readers to navigate the binary representation of the root signature by
446
448
providing counts and offsets to locate each component within the serialized data.
447
449
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
+
448
459
Root Parameter Header
449
-
~~~~~~~~~~~~~~~~~~~~~
460
+
'''''''''''''''''''''
450
461
451
462
.. code-block:: c
452
463
@@ -470,17 +481,14 @@ the parameter's basic attributes:
470
481
The header uses a parameter type field rather than encoding the version of the parameter through
471
482
size, allowing for a more explicit representation of the parameter's nature.
472
483
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.
479
487
480
488
Root Constants
481
-
~~~~~~~~~~~~~~
489
+
^^^^^^^^^^^^^^
482
490
483
-
.. code-block:: cpp
491
+
.. code-block:: c
484
492
485
493
struct RootConstants {
486
494
uint32_t ShaderRegister;
@@ -499,12 +507,12 @@ Root constants provide a fast way to pass small amounts of data directly to the
499
507
overhead of creating and binding a constant buffer resource.
500
508
501
509
Root Descriptor
502
-
~~~~~~~~~~~~~~~
510
+
^^^^^^^^^^^^^^^
503
511
504
512
Root descriptors provide a mechanism for binding individual resources to shader stages in the Direct3D 12
505
513
rendering pipeline. They allow applications to specify how shader stages access specific GPU resources.
506
514
507
-
.. code-block:: cpp
515
+
.. code-block:: c
508
516
509
517
enum RootDescriptorFlags {
510
518
None = 0,
@@ -532,25 +540,24 @@ performing further code optimizations. For details, check
532
540
`Direct X documentation <https://learn.microsoft.com/en-us/windows/win32/direct3d12/root-signature-version-1-1#static-and-volatile-flags>`_.
533
541
534
542
Version 1.0 Root Descriptor
535
-
'''''''''''''''''''''''''''
543
+
"""""""""""""""""""""""""""
536
544
The Version 1.0 RootDescriptor_V1_0 provides basic resource binding:
537
545
538
546
#. **ShaderRegister**: The shader register where the descriptor is bound.
539
547
#. **RegisterSpace**: The register space used for the binding.
540
548
541
549
Version 1.1 Root Descriptor
542
-
'''''''''''''''''''''''''''
550
+
"""""""""""""""""""""""""""
543
551
The Version 1.1 RootDescriptor_V1_1 extends the base structure with the following additional fields:
544
552
545
553
#. **Flags**: Provides additional metadata about the descriptor's usage pattern.
546
554
547
555
Root Descriptor Table
548
-
~~~~~~~~~~~~~~~~~~~~~
549
-
556
+
^^^^^^^^^^^^^^^^^^^^^
550
557
Descriptor tables function as containers that hold references to descriptors in descriptor heaps.
551
558
They allow multiple descriptors to be bound to the pipeline through a single root signature parameter.
552
559
553
-
.. code-block:: cpp
560
+
.. code-block:: c
554
561
555
562
struct DescriptorRange_V1_0 {
556
563
dxbc::DescriptorRangeType RangeType;
@@ -588,7 +595,7 @@ They allow multiple descriptors to be bound to the pipeline through a single roo
588
595
589
596
590
597
Descriptor Range Version 1.0
591
-
''''''''''''''''''''''''''''
598
+
""""""""""""""""""""""""""""
592
599
The Version 1.0 ``DescriptorRange_V1_0`` provides basic descriptor range definition:
593
600
594
601
#. **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
598
605
#. **OffsetInDescriptorsFromTableStart**: Offset from the descriptor heap start
599
606
600
607
Descriptor Range Version 1.1
601
-
''''''''''''''''''''''''''''
608
+
""""""""""""""""""""""""""""
602
609
The Version 1.1 DescriptorRange_V1_1 extends the base structure with performance optimization flags.
603
610
604
611
#. **Flags**: Provide additional information about the descriptors and enable further driver optimizations.
605
612
For details, check `Direct X documentation <https://learn.microsoft.com/en-us/windows/win32/direct3d12/root-signature-version-1-1#static-and-volatile-flags>`_.
0 commit comments