Skip to content

Commit b390cd2

Browse files
authored
Adding root descriptor subsection
1 parent e1d385a commit b390cd2

File tree

1 file changed

+49
-1
lines changed

1 file changed

+49
-1
lines changed

llvm/docs/DirectX/DXContainer.rst

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,4 +496,52 @@ signature and passed to the shader without requiring a constant buffer resource:
496496
#. **RegisterSpace**: The register space used for the binding.
497497
#. **Num32BitValues**: The number of 32-bit values included in this constant buffer.
498498

499-
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.
499+
Root constants provide a fast way to pass small amounts of data directly to the shader without the overhead
500+
of creating and binding a constant buffer resource.
501+
502+
Root Descriptor
503+
~~~~~~~~~~~~~~
504+
505+
Root descriptors provide a direct mechanism for binding individual resources to shader stages in the Direct3D 12
506+
rendering pipeline. They represent a critical interface for efficient resource management, allowing applications
507+
to specify how shader stages access specific GPU resources.
508+
509+
.. code-block:: cpp
510+
511+
// Version 1.0 Root Descriptor
512+
struct RootDescriptor_V1_0 {
513+
uint32_t ShaderRegister;
514+
uint32_t RegisterSpace;
515+
};
516+
517+
// Version 1.1 Root Descriptor
518+
struct RootDescriptor_V1_1 {
519+
uint32_t ShaderRegister;
520+
uint32_t RegisterSpace;
521+
// New flags for Version 1.1
522+
enum Flags {
523+
None = 0x0,
524+
DATA_STATIC = 0x1,
525+
DATA_STATIC_WHILE_SET_AT_EXECUTE = 0x2,
526+
DATA_VOLATILE = 0x4
527+
};
528+
529+
// Bitfield of flags from the Flags enum
530+
uint32_t Flags;
531+
};
532+
533+
The Root Descriptor structure has evolved to support two versions, providing enhanced flexibility and
534+
performance optimization capabilities.
535+
536+
Version 1.0 Root Descriptor
537+
'''''''''''''''''''''''''''
538+
The Version 1.0 RootDescriptor_V1_0 provides basic resource binding:
539+
540+
#. **ShaderRegister**: The shader register where the descriptor is bound.
541+
#. **RegisterSpace**: The register space used for the binding.
542+
543+
Version 1.1 Root Descriptor
544+
'''''''''''''''''''''''''''
545+
The Version 1.1 RootDescriptor_V1_1 extends the base structure with the following additional fields:
546+
547+
#. **Flags**: Provides additional metadata about the descriptor's usage pattern.

0 commit comments

Comments
 (0)