Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 48 additions & 1 deletion llvm/docs/DirectX/DXContainer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -496,4 +496,51 @@ signature and passed to the shader without requiring a constant buffer resource:
#. **RegisterSpace**: The register space used for the binding.
#. **Num32BitValues**: The number of 32-bit values included in this constant buffer.

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

Root Descriptor
~~~~~~~~~~~~~~~

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

.. code-block:: cpp

enum RootDescriptorFlags {
None = 0,
DataVolatile = 0x2,
DataStaticWhileSetAtExecute = 0x4,
DataStatic = 0x8,
}

// Version 1.0 Root Descriptor
struct RootDescriptor_V1_0 {
uint32_t ShaderRegister;
uint32_t RegisterSpace;
};

// Version 1.1 Root Descriptor
struct RootDescriptor_V1_1 {
uint32_t ShaderRegister;
uint32_t RegisterSpace;
// Bitfield of flags from the Flags enum
uint32_t Flags;
};

Version 1.1 of Root Descriptors has introduced some flags that can hint the drivers into
performing further code optimizations. For details, check
`Direct X documentation <https://learn.microsoft.com/en-us/windows/win32/direct3d12/root-signature-version-1-1#static-and-volatile-flags>`_.

Version 1.0 Root Descriptor
'''''''''''''''''''''''''''
The Version 1.0 RootDescriptor_V1_0 provides basic resource binding:

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

Version 1.1 Root Descriptor
'''''''''''''''''''''''''''
The Version 1.1 RootDescriptor_V1_1 extends the base structure with the following additional fields:

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