================
@@ -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
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to