summaryrefslogtreecommitdiffstats
path: root/source/slang/slang.cpp
diff options
context:
space:
mode:
authorTim Foley <tfoley@nvidia.com>2017-07-13 12:10:08 -0700
committerTim Foley <tfoley@nvidia.com>2017-07-13 13:00:38 -0700
commit6d7be3694fbaae525b2f4463630c35bed487cd5b (patch)
treea9bac151f79bba23df11c90d5906a3009dad29bd /source/slang/slang.cpp
parent4bc59f896c9df970ec27a57c397977fc4721d3cd (diff)
Add support for dumping intermediates for debugging.
Calling: spSetDumpIntermedites(compileRequest, true); will set up a mode where Slang tries to dump every intermediate HLSL, GLSL, DXBC, SPIR-V, etc. file it generates. If SPIR-V or DXBC is requested then we also dump assembly of those. Right now the files are all named as `slang-<counter>.<ext>`, and get dropped in whatever the working directory is, but I'm open to ideas on how to improve that. Note: this change introduces a new binary interface to `glslang`, so pulling it requires an updated `glslang.dll`.
Diffstat (limited to 'source/slang/slang.cpp')
-rw-r--r--source/slang/slang.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp
index bfc499c1b..89db62ec8 100644
--- a/source/slang/slang.cpp
+++ b/source/slang/slang.cpp
@@ -668,6 +668,14 @@ SLANG_API void spSetCompileFlags(
REQ(request)->compileFlags = flags;
}
+SLANG_API void spSetDumpIntermediates(
+ SlangCompileRequest* request,
+ int enable)
+{
+ REQ(request)->shouldDumpIntermediates = enable != 0;
+}
+
+
SLANG_API void spSetCodeGenTarget(
SlangCompileRequest* request,
int target)