summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-options.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-06-12 09:27:14 -0700
committerGitHub <noreply@github.com>2024-06-12 09:27:14 -0700
commitfa8c11ebe8f9b1bf2174a5a4dbe92a34c16811c8 (patch)
tree1da9ed028486e9de5a2129143ea436014a063d7c /source/slang/slang-options.cpp
parent3fe4a77287345c303aeb985e24ee237f272e8eca (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-options.cpp')
-rw-r--r--source/slang/slang-options.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp
index 4bbd0dcaf..aefb14deb 100644
--- a/source/slang/slang-options.cpp
+++ b/source/slang/slang-options.cpp
@@ -347,6 +347,7 @@ void initCommandOptions(CommandOptions& options)
{ OptionKind::SourceEmbedLanguage, "-source-embed-language", "-source-embed-language <language>",
"The language to be used for source embedding. Defaults to C/C++. Currently only C/C++ are supported"},
{ OptionKind::DisableShortCircuit, "-disable-short-circuit", nullptr, "Disable short-circuiting for \"&&\" and \"||\" operations" },
+ { OptionKind::PreserveParameters, "-preserve-params", nullptr, "Preserve all resource parameters in the output code, even if they are not used by the shader."}
};
_addOptions(makeConstArrayView(generalOpts), options);
@@ -1704,6 +1705,7 @@ SlangResult OptionsParser::_parse(
case OptionKind::NoHLSLBinding:
case OptionKind::NoHLSLPackConstantBufferElements:
case OptionKind::LoopInversion:
+ case OptionKind::PreserveParameters:
linkage->m_optionSet.set(optionKind, true); break;
break;
case OptionKind::MatrixLayoutRow: