Skip to content
Closed
Changes from 5 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
46 changes: 46 additions & 0 deletions llvm/docs/DirectX/DXContainer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -497,3 +497,49 @@ signature and passed to the shader without requiring a constant buffer resource:
#. **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 Descriptor
~~~~~~~~~~~~~~~

Root descriptors provide a direct mechanism for binding individual resources to shader stages in the Direct3D 12
rendering pipeline. They represent a critical interface for efficient resource management, allowing applications
to specify how shader stages access specific GPU resources.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imo, this strays away from the what and how tone throughout this document and into why. I think the previous pr did a good job of keeping that tone, which I presume is what we would like.


.. 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 about it, check `Direct X documentation <https://learn.microsoft.com/en-us/windows/win32/direct3d12/root-signature-version-1-1#static-and-volatile-flags>`_.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
performing further code optimizations. For details about it, check `Direct X documentation <https://learn.microsoft.com/en-us/windows/win32/direct3d12/root-signature-version-1-1#static-and-volatile-flags>`_.
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.