-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[DirectX] Updating DXContainer documentation to add Root Descriptors #129759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DirectX] Updating DXContainer documentation to add Root Descriptors #129759
Conversation
@llvm/pr-subscribers-backend-directx Author: None (joaosaffran) ChangesCloses: #129749 Full diff: https://github.com/llvm/llvm-project/pull/129759.diff 1 Files Affected:
diff --git a/llvm/docs/DirectX/DXContainer.rst b/llvm/docs/DirectX/DXContainer.rst
index 0e7026b03a606..14bc802ff6b97 100644
--- a/llvm/docs/DirectX/DXContainer.rst
+++ b/llvm/docs/DirectX/DXContainer.rst
@@ -496,4 +496,52 @@ 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 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.
+
+.. code-block:: cpp
+
+ // 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;
+ // New flags for Version 1.1
+ enum Flags {
+ None = 0x0,
+ DATA_STATIC = 0x1,
+ DATA_STATIC_WHILE_SET_AT_EXECUTE = 0x2,
+ DATA_VOLATILE = 0x4
+ };
+
+ // Bitfield of flags from the Flags enum
+ uint32_t Flags;
+ };
+
+The Root Descriptor structure has evolved to support two versions, providing enhanced flexibility and
+performance optimization capabilities.
+
+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.
|
|
llvm/docs/DirectX/DXContainer.rst
Outdated
}; | ||
|
||
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>`_. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>`_. |
llvm/docs/DirectX/DXContainer.rst
Outdated
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. |
There was a problem hiding this comment.
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.
Closes: #129749