diff options
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/slang-compiler.cpp | 1 | ||||
| -rwxr-xr-x | source/slang/slang-compiler.h | 7 | ||||
| -rw-r--r-- | source/slang/slang.cpp | 7 |
3 files changed, 15 insertions, 0 deletions
diff --git a/source/slang/slang-compiler.cpp b/source/slang/slang-compiler.cpp index 0a9180b30..513f9623d 100644 --- a/source/slang/slang-compiler.cpp +++ b/source/slang/slang-compiler.cpp @@ -2049,6 +2049,7 @@ namespace Slang m_program); backEndRequest->shouldDumpIR = (m_targetReq->getTargetFlags() & SLANG_TARGET_FLAG_DUMP_IR) != 0; + backEndRequest->shouldDumpIntermediates = m_targetReq->shouldDumpIntermediates(); return _createEntryPointResult( entryPointIndex, diff --git a/source/slang/slang-compiler.h b/source/slang/slang-compiler.h index 727d21c3a..4ed30ed28 100755 --- a/source/slang/slang-compiler.h +++ b/source/slang/slang-compiler.h @@ -1301,6 +1301,10 @@ namespace Slang { lineDirectiveMode = mode; } + void setDumpIntermediates(bool value) + { + dumpIntermediates = value; + } void addCapability(CapabilityAtom capability); bool shouldEmitSPIRVDirectly() @@ -1313,6 +1317,8 @@ namespace Slang return (targetFlags & SLANG_TARGET_FLAG_GENERATE_WHOLE_PROGRAM) != 0; } + bool shouldDumpIntermediates() { return dumpIntermediates; } + Linkage* getLinkage() { return linkage; } CodeGenTarget getTarget() { return format; } Profile getTargetProfile() { return targetProfile; } @@ -1340,6 +1346,7 @@ namespace Slang List<CapabilityAtom> rawCapabilities; CapabilitySet cookedCapabilities; LineDirectiveMode lineDirectiveMode = LineDirectiveMode::Default; + bool dumpIntermediates = false; }; /// Are we generating code for a D3D API? diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index b6359146c..b79d97331 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -3921,6 +3921,13 @@ void EndToEndCompileRequest::setCompileFlags(SlangCompileFlags flags) void EndToEndCompileRequest::setDumpIntermediates(int enable) { getBackEndReq()->shouldDumpIntermediates = (enable != 0); + + // Change all existing targets to use the new setting. + auto linkage = getLinkage(); + for (auto& target : linkage->targets) + { + target->setDumpIntermediates(enable != 0); + } } void EndToEndCompileRequest::setDumpIntermediatePrefix(const char* prefix) |
