From b73afa8631c89589cb5887acbf9f78bccc7a12c5 Mon Sep 17 00:00:00 2001 From: Jeremy Hayes Date: Tue, 5 Jan 2021 15:54:41 -0700 Subject: [PATCH] Prevent HLSL input under OpenGL semantics Fix #2497. --- StandAlone/StandAlone.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp index 1f294b0..fdbf027 100644 --- a/StandAlone/StandAlone.cpp +++ b/StandAlone/StandAlone.cpp @@ -844,6 +844,10 @@ void ProcessArguments(std::vector>& workItem (Options & EOptionReadHlsl) == 0) Error("uniform array flattening only valid when compiling HLSL source."); + if ((Options & EOptionReadHlsl) && (Client == glslang::EShClientOpenGL)) { + Error("Using HLSL input under OpenGL semantics is not currently supported."); + } + // rationalize client and target language if (TargetLanguage == glslang::EShTargetNone) { switch (ClientVersion) { @@ -1561,7 +1565,8 @@ void usage() " 'ver', when present, is the version of the input semantics,\n" " which will appear in #define GL_SPIRV ver;\n" " '--client opengl100' is the same as -G100;\n" - " a '--target-env' for OpenGL will also imply '-G'\n" + " a '--target-env' for OpenGL will also imply '-G';\n" + " currently only supports GLSL\n" " -H print human readable form of SPIR-V; turns on -V\n" " -I add dir to the include search path; includer's directory\n" " is searched first, followed by left-to-right order of -I\n" -- 2.7.4