diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp index 3c36025b..0da690e9 100644 --- a/StandAlone/StandAlone.cpp +++ b/StandAlone/StandAlone.cpp @@ -356,8 +356,7 @@ void ProcessArguments(int argc, char* argv[]) if (argc > 0) { argc--; argv++; - } - else + } else Error("no specified for -S"); break; case 'G': @@ -533,14 +532,14 @@ struct ShaderCompUnit { EShLanguage stage; std::string fileName; char** text; // memory owned/managed externally - const char* fileNameList[1]; + const char* fileNameList[1]; // Need to have a special constructors to adjust the fileNameList, since back end needs a list of ptrs ShaderCompUnit(EShLanguage istage, std::string &ifileName, char** itext) { stage = istage; fileName = ifileName; - text = itext; + text = itext; fileNameList[0] = fileName.c_str(); } @@ -848,21 +847,23 @@ int C_DECL main(int argc, char* argv[]) EShLanguage FindLanguage(const std::string& name, bool parseSuffix) { size_t ext = 0; + std::string suffix; - // Search for a suffix on a filename: e.g, "myfile.frag". If given - // the suffix directly, we skip looking the '.' - if (parseSuffix) { - ext = name.rfind('.'); - if (ext == std::string::npos) { - usage(); - return EShLangVertex; - } - ++ext; - } - - std::string suffix = name.substr(ext, std::string::npos); if (shaderStageName) suffix = shaderStageName; + else { + // Search for a suffix on a filename: e.g, "myfile.frag". If given + // the suffix directly, we skip looking for the '.' + if (parseSuffix) { + ext = name.rfind('.'); + if (ext == std::string::npos) { + usage(); + return EShLangVertex; + } + ++ext; + } + suffix = name.substr(ext, std::string::npos); + } if (suffix == "vert") return EShLangVertex; @@ -957,8 +958,8 @@ void usage() " -H print human readable form of SPIR-V; turns on -V\n" " -E print pre-processed GLSL; cannot be used with -l;\n" " errors will appear on stderr.\n" - " -S uses explicit stage specified, rather then the file extension.\n" - " valid choices are vert, tesc, tese, geom, frag, or comp\n" + " -S uses specified stage rather than parsing the file extension\n" + " valid choices for are vert, tesc, tese, geom, frag, or comp\n" " -c configuration dump;\n" " creates the default configuration file (redirect to a .conf file)\n" " -C cascading errors; risks crashes from accumulation of error recoveries\n" diff --git a/Test/baseResults/nosuffix.out b/Test/baseResults/nosuffix.out new file mode 100644 index 00000000..d881c5b8 --- /dev/null +++ b/Test/baseResults/nosuffix.out @@ -0,0 +1,15 @@ +nosuffix +Shader version: 100 +0:? Sequence +0:1 Function Definition: main( ( global void) +0:1 Function Parameters: +0:3 Sequence +0:3 move second child to first child ( temp highp 4-component vector of float) +0:3 'gl_Position' ( gl_Position highp 4-component vector of float Position) +0:3 Constant: +0:3 1.000000 +0:3 1.000000 +0:3 1.000000 +0:3 1.000000 +0:? Linker Objects + diff --git a/Test/nosuffix b/Test/nosuffix new file mode 100755 index 00000000..26862fff --- /dev/null +++ b/Test/nosuffix @@ -0,0 +1,4 @@ +void main() +{ + gl_Position = vec4(1.0); +} \ No newline at end of file diff --git a/Test/runtests b/Test/runtests index a17848b7..86ffef34 100755 --- a/Test/runtests +++ b/Test/runtests @@ -66,4 +66,18 @@ else echo Tests Failed. fi +# +# Testing -S +# +echo Running explicit stage test +$EXE -i -S vert nosuffix > $TARGETDIR/nosuffix.out +diff -b $BASEDIR/nosuffix.out $TARGETDIR/nosuffix.out || HASERROR=1 + +if [ $HASERROR -eq 0 ] +then + echo Tests Succeeded. +else + echo Tests Failed. +fi + exit $HASERROR diff --git a/glslang/Include/revision.h b/glslang/Include/revision.h index 00dc2f43..e4ff5c62 100644 --- a/glslang/Include/revision.h +++ b/glslang/Include/revision.h @@ -2,5 +2,5 @@ // For the version, it uses the latest git tag followed by the number of commits. // For the date, it uses the current date (when then script is run). -#define GLSLANG_REVISION "Overload400-PrecQual.1916" -#define GLSLANG_DATE "15-Mar-2017" +#define GLSLANG_REVISION "Overload400-PrecQual.1920" +#define GLSLANG_DATE "16-Mar-2017"