summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-ir-link.cpp
diff options
context:
space:
mode:
authorDietrich Geisler <dag368@cornell.edu>2020-07-20 14:53:23 -0400
committerGitHub <noreply@github.com>2020-07-20 11:53:23 -0700
commit115920406ebd747e02e1e6a8e4595f7d88eef0d9 (patch)
treea230b6358b35569da5f588d733643198ff38293f /source/slang/slang-ir-link.cpp
parent975c5db3f0a71bc93369a321318e7d3b43001ff5 (diff)
Multiple Entry Point Backend (#1437)
* Multiple Entry Point Backend This PR introduces changes to the IR linking, emitting, and options for multiple entry points. Specifically, this PR updates several locations to support a (potentially empty) list of entry points, adding list infrastructure and looping over entry points as appropriate. * Formatting change * Updated unknown target case to not require an entry point * Formatting and list consts updates Co-authored-by: Tim Foley <tfoleyNV@users.noreply.github.com>
Diffstat (limited to 'source/slang/slang-ir-link.cpp')
-rw-r--r--source/slang/slang-ir-link.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/slang/slang-ir-link.cpp b/source/slang/slang-ir-link.cpp
index 704917629..9de2b5d1c 100644
--- a/source/slang/slang-ir-link.cpp
+++ b/source/slang/slang-ir-link.cpp
@@ -1346,7 +1346,6 @@ struct IRSpecializationState
}
};
-// TODO(DG): Generalize to multiple entry points
LinkedIR linkIR(
BackEndCompileRequest* compileRequest,
const List<Int>& entryPointIndices,
@@ -1448,12 +1447,13 @@ LinkedIR linkIR(
// arguments which might end up affecting the mangled
// entry point name.
//
- // TODO(DG): spot to generalize to multiple entry points
- // Note that only stuff referenced by an entry point gets linked here
- // Temporary assertion for checkpoint
- SLANG_ASSERT(entryPointIndices.getCount() == 1);
- auto entryPointMangledName = program->getEntryPointMangledName(entryPointIndices[0]);
- auto irEntryPoint = specializeIRForEntryPoint(context, entryPointMangledName);
+
+ List<IRFunc*> irEntryPoints;
+ for (auto entryPointIndex : entryPointIndices)
+ {
+ auto entryPointMangledName = program->getEntryPointMangledName(entryPointIndex);
+ irEntryPoints.add(specializeIRForEntryPoint(context, entryPointMangledName));
+ }
// Layout information for global shader parameters is also required,
// and in particular every global parameter that is part of the layout
@@ -1528,8 +1528,8 @@ LinkedIR linkIR(
//
LinkedIR linkedIR;
linkedIR.module = state->irModule;
- linkedIR.entryPoint = irEntryPoint;
linkedIR.globalScopeVarLayout = irGlobalScopeVarLayout;
+ linkedIR.entryPoints = irEntryPoints;
return linkedIR;
}