[llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 11 16:51:24 PST 2025
================
@@ -145,20 +134,30 @@ static bool parse(LLVMContext *Ctx, ModuleRootSignature *MRS, NamedMDNode *Root,
}
static bool validate(LLVMContext *Ctx, ModuleRootSignature *MRS) {
- if (dxbc::RootSignatureValidations::validateRootFlag(MRS->Flags)) {
+ if (!dxbc::RootSignatureValidations::isValidRootFlag(MRS->Flags)) {
return reportError(Ctx, "Invalid Root Signature flag value");
}
return false;
}
std::optional<ModuleRootSignature>
-ModuleRootSignature::analyzeModule(Module &M, const Function *F) {
- ModuleRootSignature MRS;
+ModuleRootSignature::analyzeModule(Module &M, ModuleMetadataInfo MMI) {
+ if (MMI.ShaderProfile == Triple::Library)
+ return std::nullopt;
+
LLVMContext *Ctx = &M.getContext();
+ if (MMI.EntryPropertyVec.size() != 1) {
+ reportError(Ctx, "More than one entry function defined.");
+ return std::nullopt;
+ }
----------------
joaosaffran wrote:
I've added a few tests to cover this scenario. There are other parts of DXContainerGlobals that enforce to exist a single entry function. Based on the team discussion, this is safe to assume when generating DXContainer. We might need a different workflow when we add support to Library Shaders though
https://github.com/llvm/llvm-project/pull/123147
More information about the llvm-commits
mailing list