From 115920406ebd747e02e1e6a8e4595f7d88eef0d9 Mon Sep 17 00:00:00 2001 From: Dietrich Geisler Date: Mon, 20 Jul 2020 14:53:23 -0400 Subject: 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 --- source/slang/slang-ir-link.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source/slang/slang-ir-link.cpp') 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& 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 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; } -- cgit v1.2.3