From 82a7de3b1a22eb7f7630d5b2d6998916ede45a8c Mon Sep 17 00:00:00 2001 From: joaosaffran <126493771+joaosaffran@users.noreply.github.com> Date: Tue, 4 Mar 2025 14:32:03 -0800 Subject: [PATCH 1/3] Updating Root Descriptor documentation --- llvm/docs/DirectX/DXContainer.rst | 70 +++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) 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 + From 16e3642a23540edb2e306899999655ef0e9722f2 Mon Sep 17 00:00:00 2001 From: joaosaffran <126493771+joaosaffran@users.noreply.github.com> Date: Thu, 6 Mar 2025 11:10:41 -0800 Subject: [PATCH 2/3] Update DXContainer.rst --- llvm/docs/DirectX/DXContainer.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/docs/DirectX/DXContainer.rst b/llvm/docs/DirectX/DXContainer.rst index fd1ff3f04a008..0c652ed65c528 100644 --- a/llvm/docs/DirectX/DXContainer.rst +++ b/llvm/docs/DirectX/DXContainer.rst @@ -568,7 +568,7 @@ root signature space consumption. uint32_t BaseShaderRegister; uint32_t RegisterSpace; uint32_t OffsetInDescriptorsFromTableStart; - Copy// New flags for Version 1.1 + // New flags for Version 1.1 enum Flags { None = 0x0, // Descriptors are static and known at root signature creation From fcabc0ec08da3e28d7e65bd578c7ca0fdeae7a9d Mon Sep 17 00:00:00 2001 From: joaosaffran <126493771+joaosaffran@users.noreply.github.com> Date: Tue, 11 Mar 2025 14:31:23 -0700 Subject: [PATCH 3/3] Address PR Comments --- llvm/docs/DirectX/DXContainer.rst | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/llvm/docs/DirectX/DXContainer.rst b/llvm/docs/DirectX/DXContainer.rst index 0c652ed65c528..40c088462a452 100644 --- a/llvm/docs/DirectX/DXContainer.rst +++ b/llvm/docs/DirectX/DXContainer.rst @@ -548,9 +548,8 @@ The Version 1.1 RootDescriptor_V1_1 extends the base structure with the followin 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. +Descriptor tables function as containers that hold references to descriptors in descriptor heaps. +They allow multiple descriptors to be bound to the pipeline through a single root signature parameter. .. code-block:: cpp @@ -591,7 +590,6 @@ root signature space consumption. 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) @@ -605,10 +603,10 @@ 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. + For details, check `Direct X documentation `_. Root Descriptor Table ''''''''''''''''''''' - RootDescriptorTable provides basic table structure: #. **NumDescriptorRanges**: Number of descriptor ranges