Infrastructure: If using .hlsl suffix, default is -D.
diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp
index 1986a2f..6736dbc 100644
--- a/StandAlone/StandAlone.cpp
+++ b/StandAlone/StandAlone.cpp
@@ -1214,11 +1214,13 @@
bool hasSecondExt = secondExtStart != std::string::npos;
std::string firstExt = name.substr(firstExtStart + 1, std::string::npos);
bool usesUnifiedExt = hasFirstExt && (firstExt == "glsl" || firstExt == "hlsl");
- if (hasFirstExt && !usesUnifiedExt) {
+ if (usesUnifiedExt && firstExt == "hlsl")
+ Options |= EOptionReadHlsl;
+ if (hasFirstExt && !usesUnifiedExt)
stageName = firstExt;
- } else if (usesUnifiedExt && hasSecondExt) {
+ else if (usesUnifiedExt && hasSecondExt)
stageName = name.substr(secondExtStart + 1, firstExtStart - secondExtStart - 1);
- } else {
+ else {
usage();
return EShLangVertex;
}
@@ -1311,7 +1313,7 @@
"\n"
"Options:\n"
" -C cascading errors; risk crash from accumulation of error recoveries\n"
- " -D input is HLSL\n"
+ " -D input is HLSL (default when any suffix is .hlsl)\n"
" -D<macro=def>\n"
" -D<macro> define a pre-processor macro\n"
" -E print pre-processed GLSL; cannot be used with -l;\n"
diff --git a/Test/runtests b/Test/runtests
index 93429a1..51e15c0 100755
--- a/Test/runtests
+++ b/Test/runtests
@@ -81,7 +81,7 @@
diff -b $BASEDIR/nosuffix.out $TARGETDIR/nosuffix.out || HASERROR=1
$EXE -i compoundsuffix.vert.glsl > $TARGETDIR/compoundsuffix.vert.glsl
diff -b $BASEDIR/compoundsuffix.vert.glsl $TARGETDIR/compoundsuffix.vert.glsl || HASERROR=1
-$EXE -D -e main -H compoundsuffix.frag.hlsl > $TARGETDIR/compoundsuffix.frag.hlsl
+$EXE -e main -H compoundsuffix.frag.hlsl > $TARGETDIR/compoundsuffix.frag.hlsl
diff -b $BASEDIR/compoundsuffix.frag.hlsl $TARGETDIR/compoundsuffix.frag.hlsl || HASERROR=1
#