Skip to content

Conversation

@joaosaffran
Copy link
Contributor

Closes: #129796

@llvmbot
Copy link
Member

llvmbot commented Mar 4, 2025

@llvm/pr-subscribers-backend-directx

Author: None (joaosaffran)

Changes

Closes: #129796


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

1 Files Affected:

  • (modified) llvm/docs/DirectX/DXContainer.rst (+70)
diff --git a/llvm/docs/DirectX/DXContainer.rst b/llvm/docs/DirectX/DXContainer.rst
index b9a2067368e0f..fd1ff3f04a008 100644
--- a/llvm/docs/DirectX/DXContainer.rst
+++ b/llvm/docs/DirectX/DXContainer.rst
@@ -544,3 +544,73 @@ 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.
+
+Root Descriptor Table
+~~~~~~~~~~~~~~~~~~~~~
+
+Descriptor tables provide a flexible mechanism for grouping and managing multiple resource descriptors within 
+a single root signature parameter. They enable efficient binding of complex shader resource sets while minimizing 
+root signature space consumption.
+
+.. code-block:: cpp
+
+   struct DescriptorRange_V1_0 {
+      dxbc::DescriptorRangeType RangeType;
+      uint32_t NumDescriptors;
+      uint32_t BaseShaderRegister;
+      uint32_t RegisterSpace;
+      uint32_t OffsetInDescriptorsFromTableStart;
+   };
+
+   struct DescriptorRange_V1_1 {
+      dxbc::DescriptorRangeType RangeType;
+      uint32_t NumDescriptors;
+      uint32_t BaseShaderRegister;
+      uint32_t RegisterSpace;
+      uint32_t OffsetInDescriptorsFromTableStart;
+      Copy// New flags for Version 1.1
+      enum Flags {
+        None                        = 0x0,
+        // Descriptors are static and known at root signature creation
+        DESCRIPTORS_STATIC          = 0x1,
+        // Descriptors remain constant during command list execution
+        DESCRIPTORS_STATIC_KEEPING_BUFFER_BOUNDS_CHECKS = 0x2,
+        // Descriptors may change frequently
+        DESCRIPTORS_VOLATILE        = 0x4
+      };
+      
+      // Bitfield of flags from the Flags enum
+      uint32_t Flags;
+   };
+
+   struct RootDescriptorTable {
+      uint32_t NumDescriptorRanges;      
+      uint32_t DescriptorRangesOffset;  
+   };
+
+
+Descriptor Range Version 1.0
+''''''''''''''''''''''''''''
+
+The Version 1.0 ``DescriptorRange_V1_0`` provides basic descriptor range definition:
+
+#. **RangeType**: Type of descriptors (CBV, SRV, UAV, or Sampler)
+#. **NumDescriptors**: Number of descriptors in the range
+#. **BaseShaderRegister**: First shader register in the range
+#. **RegisterSpace**: Register space for the range
+#. **OffsetInDescriptorsFromTableStart**: Offset from the descriptor heap start
+
+Descriptor Range Version 1.1
+''''''''''''''''''''''''''''
+The Version 1.1 DescriptorRange_V1_1 extends the base structure with performance optimization flags.
+
+#. **Flags**: Provide additional information about the descriptors and enable further driver optimizations.
+
+Root Descriptor Table
+'''''''''''''''''''''
+
+RootDescriptorTable provides basic table structure:
+
+#. **NumDescriptorRanges**: Number of descriptor ranges
+#. **DescriptorRangesOffset**: Offset to descriptor range array
+

@github-actions
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.

Comment on lines 551 to 553
Descriptor tables provide a flexible mechanism for grouping and managing multiple resource descriptors within
a single root signature parameter. They enable efficient binding of complex shader resource sets while minimizing
root signature space consumption.
Copy link
Contributor

@inbelic inbelic Mar 10, 2025

Choose a reason for hiding this comment

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

I think #129759 (comment) applies here as well (what and how vs why)

@joaosaffran joaosaffran requested a review from inbelic March 11, 2025 21:32
@joaosaffran joaosaffran deleted the documentation/descriptor-tables branch March 17, 2025 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants