[llvm-branch-commits] [clang] [llvm] [DirectX] Updating Root Signature Metadata to contain Static Sampler flags (PR #160210)

Justin Bogner via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Sep 26 09:27:37 PDT 2025


================
@@ -212,7 +212,7 @@ MDNode *MetadataBuilder::BuildStaticSampler(const StaticSampler &Sampler) {
       ConstantAsMetadata::get(Builder.getInt32(Sampler.Space)),
       ConstantAsMetadata::get(
           Builder.getInt32(to_underlying(Sampler.Visibility))),
-  };
+      ConstantAsMetadata::get(Builder.getInt32(0))};
----------------
bogner wrote:

There are a few ways to stage this, but I agree that if we're doing either the backend or the frontend first we run into similar problems. However, I do share @inbelic's concern that this is a bit of an awkward temporary state.

It might be worthwhile to just wire up enough of the frontend in this PR that it's explicitly writing out the empty flags. That is, update the [StaticSampler definition](https://github.com/joaosaffran/llvm-project/blob/main/llvm/include/llvm/Frontend/HLSL/HLSLRootSignature.h#L120) to include the flags now, but just initialize it to zero in the frontend. This way the metadata stays consistent between the frontend and the backend.

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


More information about the llvm-branch-commits mailing list