summaryrefslogtreecommitdiffstats
path: root/source/slang/slang.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang.cpp')
-rw-r--r--source/slang/slang.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp
index 6f5e79458..cf8c19033 100644
--- a/source/slang/slang.cpp
+++ b/source/slang/slang.cpp
@@ -3149,6 +3149,24 @@ 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.
+ for (auto targetReq : getLinkage()->targets)
+ {
+ if (targetReq->getOptionSet().getBoolOption(CompilerOptionName::EmbedDXIL))
+ {
+ auto frontEndReq = getFrontEndReq();
+
+ for (auto translationUnit : frontEndReq->translationUnits)
+ {
+ translationUnit->getModule()->precompileForTargets(
+ getSink(),
+ this,
+ targetReq);
+ }
+ }
+ }
+
// If codegen is enabled, we need to move along to
// apply any generic specialization that the user asked for.
//
@@ -5758,6 +5776,16 @@ void EndToEndCompileRequest::setTargetMatrixLayoutMode(int targetIndex, SlangMat
getTargetOptionSet(targetIndex).setMatrixLayoutMode(MatrixLayoutMode(mode));
}
+void EndToEndCompileRequest::setTargetGenerateWholeProgram(int targetIndex, bool value)
+{
+ getTargetOptionSet(targetIndex).set(CompilerOptionName::GenerateWholeProgram, value);
+}
+
+void EndToEndCompileRequest::setTargetEmbedDXIL(int targetIndex, bool value)
+{
+ getTargetOptionSet(targetIndex).set(CompilerOptionName::EmbedDXIL, value);
+}
+
void EndToEndCompileRequest::setTargetLineDirectiveMode(
SlangInt targetIndex,
SlangLineDirectiveMode mode)