[llvm] [DirectX backend] generate ISG1, OSG1 part for compute shader (PR #90508)
Xiang Li via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 29 13:25:43 PDT 2024
================
@@ -104,6 +110,50 @@ GlobalVariable *DXContainerGlobals::computeShaderHash(Module &M) {
return GV;
}
+GlobalVariable *DXContainerGlobals::buildContainerGlobal(
+ Module &M, Constant *Content, StringRef Name, StringRef SectionName) {
+ auto *GV = new llvm::GlobalVariable(
+ M, Content->getType(), true, GlobalValue::PrivateLinkage, Content, Name);
+ GV->setSection(SectionName);
+ GV->setAlignment(Align(4));
+ return GV;
+}
+
+GlobalVariable *DXContainerGlobals::buildInputSingature(Module &M,
+ Constant *Content) {
+ return buildContainerGlobal(M, Content, "dx.isg1", "ISG1");
+}
+GlobalVariable *DXContainerGlobals::buildOutputSingature(Module &M,
+ Constant *Content) {
+ return buildContainerGlobal(M, Content, "dx.osg1", "OSG1");
+}
+
+void DXContainerGlobals::addSingature(Module &M,
+ SmallVector<GlobalValue *> &Globals,
+ Triple &TT) {
+ dxbc::ProgramSignatureHeader Sig;
----------------
python3kgae wrote:
Updated.
https://github.com/llvm/llvm-project/pull/90508
More information about the llvm-commits
mailing list