Skip to content
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

Open
wants to merge 5 commits into
base: users/joaosaffran/129569
Choose a base branch
from

Conversation

joaosaffran
Copy link
Contributor

Closes: #129749

@joaosaffran joaosaffran changed the title Adding root descriptor subsection [DirectX] Updating DXContainer documentation to add Root Descriptors Mar 4, 2025
@llvmbot
Copy link
Member

llvmbot commented Mar 4, 2025

@llvm/pr-subscribers-backend-directx

Author: None (joaosaffran)

Changes

Closes: #129749


Full diff: https://github.com/llvm/llvm-project/pull/129759.diff

1 Files Affected:

  • (modified) llvm/docs/DirectX/DXContainer.rst (+49-1)
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.

Copy link

github-actions bot commented Mar 4, 2025

⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo.
Please turn off Keep my email addresses private setting in your account.
See LLVM Discourse for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants