From fa8c11ebe8f9b1bf2174a5a4dbe92a34c16811c8 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 12 Jun 2024 09:27:14 -0700 Subject: Add option to preserve shader parameter declaration in output SPIRV. (#4344) * Add option to preserve shader parameter declarations in output. * Add test. --- source/slang/slang-options.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/slang/slang-options.cpp') 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 ", "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: -- cgit v1.2.3