diff options
| author | Yong He <yonghe@outlook.com> | 2024-06-12 09:27:14 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-12 09:27:14 -0700 |
| commit | fa8c11ebe8f9b1bf2174a5a4dbe92a34c16811c8 (patch) | |
| tree | 1da9ed028486e9de5a2129143ea436014a063d7c /source/slang/slang-emit-spirv.cpp | |
| parent | 3fe4a77287345c303aeb985e24ee237f272e8eca (diff) | |
Add option to preserve shader parameter declaration in output SPIRV. (#4344)
* Add option to preserve shader parameter declarations in output.
* Add test.
Diffstat (limited to 'source/slang/slang-emit-spirv.cpp')
| -rw-r--r-- | source/slang/slang-emit-spirv.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/slang/slang-emit-spirv.cpp b/source/slang/slang-emit-spirv.cpp index fd4b1d491..10c263793 100644 --- a/source/slang/slang-emit-spirv.cpp +++ b/source/slang/slang-emit-spirv.cpp @@ -6431,10 +6431,13 @@ SlangResult emitSPIRVFromIR( } #endif + auto shouldPreserveParams = codeGenContext->getTargetProgram()->getOptionSet().getBoolOption(CompilerOptionName::PreserveParameters); for (auto inst : irModule->getGlobalInsts()) { if (as<IRDebugSource>(inst)) context.ensureInst(inst); + if (shouldPreserveParams && as<IRGlobalParam>(inst)) + context.ensureInst(inst); } // Emit source language info. |
