summaryrefslogtreecommitdiff
path: root/source/slang/slang-options.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-options.cpp')
-rw-r--r--source/slang/slang-options.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp
index 67f95df1e..1c1ad8f1c 100644
--- a/source/slang/slang-options.cpp
+++ b/source/slang/slang-options.cpp
@@ -141,6 +141,7 @@ enum class OptionKind
FileSystem,
Heterogeneous,
NoMangle,
+ AllowGLSL,
// Internal
@@ -621,7 +622,8 @@ void initCommandOptions(CommandOptions& options)
{ OptionKind::FileSystem, "-file-system", "-file-system <file-system-type>",
"Set the filesystem hook to use for a compile request."},
{ OptionKind::Heterogeneous, "-heterogeneous", nullptr, "Output heterogeneity-related code." },
- { OptionKind::NoMangle, "-no-mangle", nullptr, "Do as little mangling of names as possible." }
+ { OptionKind::NoMangle, "-no-mangle", nullptr, "Do as little mangling of names as possible." },
+ { OptionKind::AllowGLSL, "-allow-glsl", nullptr, "Enable GLSL as an input language." },
};
_addOptions(makeConstArrayView(experimentalOpts), options);
@@ -912,6 +914,8 @@ struct OptionsParser
String m_spirvCoreGrammarJSONPath;
+ bool m_allowGLSLInput = false;
+
CommandLineReader m_reader;
CommandOptionsWriter::Style m_helpStyle = CommandOptionsWriter::Style::Text;
@@ -1812,6 +1816,7 @@ SlangResult OptionsParser::_parse(
switch (optionKind)
{
case OptionKind::NoMangle: m_flags |= SLANG_COMPILE_FLAG_NO_MANGLING; break;
+ case OptionKind::AllowGLSL: m_allowGLSLInput = true; break;
case OptionKind::EmitIr: m_requestImpl->m_emitIr = true; break;
case OptionKind::LoadStdLib:
{
@@ -2152,7 +2157,7 @@ SlangResult OptionsParser::_parse(
m_compileRequest->setEnableEffectAnnotations(true);
break;
}
-
+
case OptionKind::EntryPointName:
{
CommandLineArg name;
@@ -2482,6 +2487,8 @@ SlangResult OptionsParser::_parse(
m_compileRequest->setCompileFlags(m_flags);
+ m_compileRequest->setAllowGLSLInput(m_allowGLSLInput);
+
// As a compatability feature, if the user didn't list any explicit entry
// point names, *and* they are compiling a single translation unit, *and* they
// have either specified a stage, or we can assume one from the naming