diff options
Diffstat (limited to 'source/slang/slang.cpp')
| -rw-r--r-- | source/slang/slang.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index b0898b1a0..91ed3de5f 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -3305,18 +3305,21 @@ SlangResult EndToEndCompileRequest::executeActionsInner() return SLANG_OK; } - // If requested, attempt to compile the translation unit all the way down to the target language - // and stash the result blob in an IR op. - if (getOptionSet().getBoolOption(CompilerOptionName::EmbedDXIL)) + // If requested, attempt to compile the translation unit all the way down to the target language(s) + // and stash the result blobs in IR. + for (auto target : getLinkage()->targets) { - auto frontEndReq = getFrontEndReq(); - - for (auto translationUnit : frontEndReq->translationUnits) + SlangCompileTarget targetEnum = SlangCompileTarget(target->getTarget()); + if (target->getOptionSet().getBoolOption(CompilerOptionName::EmbedDownstreamIR)) { - SlangCompileTarget target = SlangCompileTarget(SlangCompileTarget::SLANG_DXIL); - SLANG_RETURN_ON_FAIL(translationUnit->getModule()->precompileForTarget( - target, - nullptr)); + auto frontEndReq = getFrontEndReq(); + + for (auto translationUnit : frontEndReq->translationUnits) + { + SLANG_RETURN_ON_FAIL(translationUnit->getModule()->precompileForTarget( + targetEnum, + nullptr)); + } } } @@ -5939,9 +5942,9 @@ void EndToEndCompileRequest::setTargetGenerateWholeProgram(int targetIndex, bool getTargetOptionSet(targetIndex).set(CompilerOptionName::GenerateWholeProgram, value); } -void EndToEndCompileRequest::setEmbedDXIL(bool value) +void EndToEndCompileRequest::setTargetEmbedDownstreamIR(int targetIndex, bool value) { - getOptionSet().set(CompilerOptionName::EmbedDXIL, value); + getTargetOptionSet(targetIndex).set(CompilerOptionName::EmbedDownstreamIR, value); } void EndToEndCompileRequest::setTargetLineDirectiveMode( |
