diff options
| author | Yong He <yonghe@outlook.com> | 2020-06-11 17:13:27 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-11 17:13:27 -0700 |
| commit | 2359921bb7aba569b36ce3c1904b2dccbde5ffec (patch) | |
| tree | 0a351264f1085e39fd2b753dca3d4df60dc0b9a9 | |
| parent | 1c77c4454facf4cb31d0b647ef6e5ce766d61498 (diff) | |
| parent | 8452129809858e0b51eca87f8965496e6b6735a1 (diff) | |
Merge pull request #1383 from csyonghe/dyndispatch
Add compiler flag to disable specialization pass.
| -rw-r--r-- | .gitignore | 6 | ||||
| -rw-r--r-- | source/slang/slang-compiler.h | 4 | ||||
| -rw-r--r-- | source/slang/slang-emit.cpp | 3 | ||||
| -rw-r--r-- | source/slang/slang-options.cpp | 4 |
4 files changed, 16 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore index 0a20ce4b2..cf8a1ea5d 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,9 @@ tests/**/*.cpp # Files generated by other shader compilers *.spv + +# Intermediate source files generated during build process +/source/slang/slang-ast-generated.h
+/source/slang/slang-ast-generated-macro.h
+/source/slang/hlsl.meta.slang.h
+/source/slang/core.meta.slang.h
diff --git a/source/slang/slang-compiler.h b/source/slang/slang-compiler.h index f8843fadc..26648ed48 100644 --- a/source/slang/slang-compiler.h +++ b/source/slang/slang-compiler.h @@ -1759,6 +1759,10 @@ namespace Slang /// Should SPIR-V be generated directly from Slang IR rather than via translation to GLSL? bool shouldEmitSPIRVDirectly = false; + + // If true will allow generating dynamic dispatch code for generics. + bool allowDynamicCode = false; + String m_dumpIntermediatePrefix; private: diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp index 12996e783..3e0d6ae26 100644 --- a/source/slang/slang-emit.cpp +++ b/source/slang/slang-emit.cpp @@ -270,7 +270,8 @@ Result linkAndOptimizeIR( // perform specialization of functions based on parameter // values that need to be compile-time constants. // - specializeModule(irModule); + if (!compileRequest->allowDynamicCode) + specializeModule(irModule); // Debugging code for IR transformations... #if 0 diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp index 89fe03255..5bf0c6c9d 100644 --- a/source/slang/slang-options.cpp +++ b/source/slang/slang-options.cpp @@ -557,6 +557,10 @@ struct OptionsParser { requestImpl->getFrontEndReq()->useSerialIRBottleneck = true; } + else if (argStr == "-allow-dynamic-code") + { + requestImpl->getBackEndReq()->allowDynamicCode = true; + } else if (argStr == "-verbose-paths") { requestImpl->getSink()->setFlag(DiagnosticSink::Flag::VerbosePath); |
