HLSL: add optional position.Y inversion
Adds command line options:
--invert-y
--iy
(synonyms) which invert position.Y on vertex shader output. Handles these cases:
* Direct single variable return
* Member of direct returned struct
* Single variable output parameter
* Member of struct output parameter
API:
// Enables position.Y output negation in vertex shader
void TShader::setInvertY(bool invert);
Fixes #1173
diff --git a/Test/runtests b/Test/runtests
index 814210b..3a5b175 100755
--- a/Test/runtests
+++ b/Test/runtests
@@ -187,6 +187,17 @@
diff -b $BASEDIR/remap.invalid-spirv-2.out $TARGETDIR/remap.invalid-spirv-2.out || HASERROR=1
#
+# Testing position Y inversion
+#
+echo "Testing position Y inversion"
+$EXE -H -e main -V -D -H -i --iy hlsl.y-negate-1.vert > $TARGETDIR/hlsl.y-negate-1.vert.out
+diff -b $BASEDIR/hlsl.y-negate-1.vert.out $TARGETDIR/hlsl.y-negate-1.vert.out || HASERROR=1
+$EXE -H -e main -V -D -H -i --invert-y hlsl.y-negate-2.vert > $TARGETDIR/hlsl.y-negate-2.vert.out
+diff -b $BASEDIR/hlsl.y-negate-2.vert.out $TARGETDIR/hlsl.y-negate-2.vert.out || HASERROR=1
+$EXE -H -e main -V -D -H -i --invert-y hlsl.y-negate-3.vert > $TARGETDIR/hlsl.y-negate-3.vert.out
+diff -b $BASEDIR/hlsl.y-negate-3.vert.out $TARGETDIR/hlsl.y-negate-3.vert.out || HASERROR=1
+
+#
# Final checking
#
if [ $HASERROR -eq 0 ]