diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2021-09-01 18:38:43 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-01 15:38:43 -0700 |
| commit | 09e32c11b6cd77acbe1b1f6e865c861932433b1d (patch) | |
| tree | b20389ea78f97d7ab73eae5022277cec815e2cf9 /source/slang/slang-compiler.cpp | |
| parent | b2ad8e99a82884bb157e1be76b1ad7eb0e481457 (diff) | |
Improving glslang -O1 passes (#1926)
* #include an absolute path didn't work - because paths were taken to always be relative.
* Improve passes used for -O1 option with glslang.
* Set sourceManager when serializing container.
Diffstat (limited to 'source/slang/slang-compiler.cpp')
| -rw-r--r-- | source/slang/slang-compiler.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/slang/slang-compiler.cpp b/source/slang/slang-compiler.cpp index 5d0ae2f8d..0a9180b30 100644 --- a/source/slang/slang-compiler.cpp +++ b/source/slang/slang-compiler.cpp @@ -2094,10 +2094,6 @@ namespace Slang SerialContainerUtil::WriteOptions options; options.compressionType = linkage->serialCompressionType; - if (linkage->debugInfoLevel != DebugInfoLevel::None) - { - options.optionFlags |= SerialOptionFlag::SourceLocation; - } if (linkage->m_obfuscateCode) { // If code is obfuscated, we *disable* AST output as it is not obfuscated and will reveal @@ -2105,6 +2101,11 @@ namespace Slang // Also currently only IR is needed. options.optionFlags &= ~SerialOptionFlag::ASTModule; } + else if (linkage->debugInfoLevel != DebugInfoLevel::None && linkage->getSourceManager()) + { + options.optionFlags |= SerialOptionFlag::SourceLocation; + options.sourceManager = linkage->getSourceManager(); + } { RiffContainer container; |
