[clang] [llvm] [DirectX] Removing dxbc DescriptorRange from mcbxdc (PR #154629)

via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 10 10:47:18 PDT 2025


================
@@ -209,6 +202,13 @@ inline bool isValidParameterType(uint32_t V) {
   return false;
 }
 
+inline bool isValidRangeType(uint32_t V) {
+  static_assert(llvm::to_underlying(dxil::ResourceClass::Sampler) == 3,
+                "dxil::ResourceClass numeric values must match the Root "
+                "Signature values associated to each class.");
+  return V <= llvm::to_underlying(dxil::ResourceClass::Sampler);
----------------
joaosaffran wrote:

@bogner Thanks, that make sense. One question, How can I make sure the enum values are still assigned to the correct numbers? Like, SRV must be 0, UAV must be 1 and so on. 

We have those tests failing if we change the order of elements in the enum. Is that good enough?

```
  LLVM :: Analysis/DXILResource/buffer-frombinding.ll
  LLVM :: CodeGen/DirectX/BufferLoad.ll
  LLVM :: CodeGen/DirectX/ContainerData/PSVResources-order.ll
  LLVM :: CodeGen/DirectX/ContainerData/PSVResources.ll
  LLVM :: CodeGen/DirectX/ContainerData/RootSignature-DescriptorTable-AllValidFlagCombinations.ll
  LLVM :: CodeGen/DirectX/ContainerData/RootSignature-DescriptorTable-AllValidFlagCombinationsV1.ll
  LLVM :: CodeGen/DirectX/ContainerData/RootSignature-DescriptorTable.ll
  LLVM :: CodeGen/DirectX/CreateHandle.ll
  LLVM :: CodeGen/DirectX/CreateHandleFromBinding.ll
```

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


More information about the llvm-commits mailing list