[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Jan 30 16:29:33 PST 2025


================
@@ -144,6 +149,27 @@ void DXContainerGlobals::addSignature(Module &M,
   Globals.emplace_back(buildSignature(M, OutputSig, "dx.osg1", "OSG1"));
 }
 
+void DXContainerGlobals::addRootSignature(Module &M,
+                                          SmallVector<GlobalValue *> &Globals) {
+
+  std::optional<ModuleRootSignature> MRS =
+      getAnalysis<RootSignatureAnalysisWrapper>().getRootSignature();
+  if (!MRS.has_value())
+    return;
+
+  SmallString<256> Data;
+  raw_svector_ostream OS(Data);
+
+  RootSignatureHeader RSH;
+  RSH.Flags = MRS->Flags;
+
+  RSH.write(OS);
----------------
joaosaffran wrote:

This change is writing the in memory rootsignature representation into a global variable in dxil, that is what DXContainerGlobals has done with PSV0, which I reference to implement this. 

The target branch is intentional, the targeted PR contains the logic serialization and deserialization of Root Flags using obj2yaml. This change is required to implement tests in this PR.

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


More information about the llvm-branch-commits mailing list