[llvm] [DirectX] adding support to read/write descriptor table data using obj2yaml/yaml2obj (PR #138315)

via llvm-commits llvm-commits at lists.llvm.org
Thu May 22 10:16:46 PDT 2025


================
@@ -595,6 +607,21 @@ struct RootDescriptor {
     sys::swapByteOrder(RegisterSpace);
   }
 };
+
+struct DescriptorRange {
+  uint32_t RangeType;
+  uint32_t NumDescriptors;
+  uint32_t BaseShaderRegister;
+  uint32_t RegisterSpace;
+  int32_t OffsetInDescriptorsFromTableStart;
----------------
joaosaffran wrote:

Just checked the spec, I made a mistake `NumDescriptors` allows -1 to describe unbounded [UINT_MAX ](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ns-d3d12-d3d12_descriptor_range#members). 

According to the spec: "Use -1 or UINT_MAX to specify an unbounded size.", my understanding is that only -1 is a valid here. 

Since folks are annoyed with this I will make it `uint32_t`.

https://github.com/llvm/llvm-project/pull/138315


More information about the llvm-commits mailing list