From 318adcc27b8d89ec1d47c445a93239dd81be0b31 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 12 Jun 2024 09:45:26 -0700 Subject: Add compiler option to treat enum types as unscoped. (#4354) --- source/slang/slang-options.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/slang/slang-options.cpp') diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp index aefb14deb..04d48c85f 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::UnscopedEnum, "-unscoped-enum", nullptr, "Treat enums types as unscoped by default."} { OptionKind::PreserveParameters, "-preserve-params", nullptr, "Preserve all resource parameters in the output code, even if they are not used by the shader."} }; @@ -1705,8 +1706,9 @@ SlangResult OptionsParser::_parse( case OptionKind::NoHLSLBinding: case OptionKind::NoHLSLPackConstantBufferElements: case OptionKind::LoopInversion: + case OptionKind::UnscopedEnum: case OptionKind::PreserveParameters: - linkage->m_optionSet.set(optionKind, true); break; + linkage->m_optionSet.set(optionKind, true); break; case OptionKind::MatrixLayoutRow: case OptionKind::MatrixLayoutColumn: -- cgit v1.2.3