2013-02-12 18:26:15 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2019-10-16 17:08:48 +00:00
|
|
|
# Arguments:
|
|
|
|
# 1- TargetDirectory, where to write test results and intermediary files
|
|
|
|
# 2- Path to glslangValidator
|
|
|
|
# 3- Path to spirv-remap
|
|
|
|
|
|
|
|
TARGETDIR=${1:-localResults}
|
2013-08-05 15:52:03 +00:00
|
|
|
BASEDIR=baseResults
|
2019-10-16 17:08:48 +00:00
|
|
|
EXE=${2:-../build/install/bin/glslangValidator}
|
|
|
|
REMAPEXE=${3:-../build/install/bin/spirv-remap}
|
2015-05-15 19:01:17 +00:00
|
|
|
HASERROR=0
|
2019-10-15 20:47:28 +00:00
|
|
|
mkdir -p $TARGETDIR
|
2013-09-04 21:19:27 +00:00
|
|
|
|
2020-07-14 11:56:26 +00:00
|
|
|
LIBPATH="$(cd "$(dirname "$(dirname $EXE)")" && pwd)/lib"
|
|
|
|
if [ -d "${LIBPATH}" ]; then
|
|
|
|
export LD_LIBRARY_PATH="${LIBPATH}:${LD_LIBRARY_PATH}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
function run {
|
|
|
|
$EXE $@
|
|
|
|
result=$?
|
|
|
|
case "$result" in
|
|
|
|
[0-6]) # Valid success and error codes
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "$EXE returned $result"
|
|
|
|
HASERROR=1
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2014-04-14 15:46:40 +00:00
|
|
|
if [ -a localtestlist ]
|
|
|
|
then
|
|
|
|
while read t; do
|
|
|
|
echo Running $t...
|
|
|
|
b=`basename $t`
|
2020-07-14 11:56:26 +00:00
|
|
|
run -i -l $t > $TARGETDIR/$b.out
|
2015-05-15 19:01:17 +00:00
|
|
|
diff -b $BASEDIR/$b.out $TARGETDIR/$b.out || HASERROR=1
|
2014-04-14 15:46:40 +00:00
|
|
|
done < localtestlist
|
|
|
|
fi
|
|
|
|
|
2015-06-26 06:12:31 +00:00
|
|
|
rm -f comp.spv frag.spv geom.spv tesc.spv tese.spv vert.spv
|
2015-05-15 18:44:16 +00:00
|
|
|
|
2016-07-19 20:32:52 +00:00
|
|
|
#
|
|
|
|
# special tests
|
|
|
|
#
|
|
|
|
|
2020-07-14 11:56:26 +00:00
|
|
|
run badMacroArgs.frag > $TARGETDIR/badMacroArgs.frag.out
|
2016-07-19 20:32:52 +00:00
|
|
|
diff -b $BASEDIR/badMacroArgs.frag.out $TARGETDIR/badMacroArgs.frag.out || HASERROR=1
|
|
|
|
|
2013-11-07 01:06:34 +00:00
|
|
|
#
|
|
|
|
# reflection tests
|
|
|
|
#
|
|
|
|
echo Running reflection...
|
2020-07-14 11:56:26 +00:00
|
|
|
run -l -q -C reflection.vert > $TARGETDIR/reflection.vert.out
|
2015-05-15 19:01:17 +00:00
|
|
|
diff -b $BASEDIR/reflection.vert.out $TARGETDIR/reflection.vert.out || HASERROR=1
|
2020-07-14 11:56:26 +00:00
|
|
|
run -l -q -C --reflect-strict-array-suffix --reflect-basic-array-suffix --reflect-intermediate-io --reflect-separate-buffers --reflect-all-block-variables --reflect-unwrap-io-blocks --reflect-all-io-variables --reflect-shared-std140-ubo --reflect-shared-std140-ssbo reflection.options.vert > $TARGETDIR/reflection.options.vert.out
|
2019-01-29 12:12:59 +00:00
|
|
|
diff -b $BASEDIR/reflection.options.vert.out $TARGETDIR/reflection.options.vert.out || HASERROR=1
|
2020-07-14 11:56:26 +00:00
|
|
|
run -l -q -C reflection.frag > $TARGETDIR/reflection.frag.out
|
2019-01-29 16:04:44 +00:00
|
|
|
diff -b $BASEDIR/reflection.frag.out $TARGETDIR/reflection.frag.out || HASERROR=1
|
2020-07-14 11:56:26 +00:00
|
|
|
run -l -q -C --reflect-strict-array-suffix --reflect-basic-array-suffix --reflect-intermediate-io --reflect-separate-buffers --reflect-all-block-variables --reflect-unwrap-io-blocks --reflect-all-io-variables --reflect-shared-std140-ubo --reflect-shared-std140-ssbo reflection.frag > $TARGETDIR/reflection.options.frag.out
|
2019-01-29 16:04:44 +00:00
|
|
|
diff -b $BASEDIR/reflection.options.frag.out $TARGETDIR/reflection.options.frag.out || HASERROR=1
|
2020-07-14 11:56:26 +00:00
|
|
|
run -l -q -C --reflect-strict-array-suffix --reflect-basic-array-suffix --reflect-intermediate-io --reflect-separate-buffers --reflect-all-block-variables --reflect-unwrap-io-blocks --reflect-all-io-variables --reflect-shared-std140-ubo --reflect-shared-std140-ssbo reflection.options.geom > $TARGETDIR/reflection.options.geom.out
|
2019-02-11 11:50:24 +00:00
|
|
|
diff -b $BASEDIR/reflection.options.geom.out $TARGETDIR/reflection.options.geom.out || HASERROR=1
|
2020-07-14 11:56:26 +00:00
|
|
|
run -l -q -C reflection.linked.vert reflection.linked.frag > $TARGETDIR/reflection.linked.out
|
2019-01-30 15:34:02 +00:00
|
|
|
diff -b $BASEDIR/reflection.linked.out $TARGETDIR/reflection.linked.out || HASERROR=1
|
2020-07-14 11:56:26 +00:00
|
|
|
run -l -q -C --reflect-strict-array-suffix --reflect-basic-array-suffix --reflect-intermediate-io --reflect-separate-buffers --reflect-all-block-variables --reflect-unwrap-io-blocks --reflect-all-io-variables --reflect-shared-std140-ubo --reflect-shared-std140-ssbo reflection.linked.vert reflection.linked.frag > $TARGETDIR/reflection.linked.options.out
|
2019-01-30 15:34:02 +00:00
|
|
|
diff -b $BASEDIR/reflection.linked.options.out $TARGETDIR/reflection.linked.options.out || HASERROR=1
|
2020-07-14 11:56:26 +00:00
|
|
|
run -D -Od -e flizv -l -q -C -V -Od hlsl.reflection.vert > $TARGETDIR/hlsl.reflection.vert.out
|
2016-09-20 05:12:48 +00:00
|
|
|
diff -b $BASEDIR/hlsl.reflection.vert.out $TARGETDIR/hlsl.reflection.vert.out || HASERROR=1
|
2020-07-14 11:56:26 +00:00
|
|
|
run -D -Od -e main -l -q -C -V -Od hlsl.reflection.binding.frag > $TARGETDIR/hlsl.reflection.binding.frag.out
|
2016-09-21 20:19:40 +00:00
|
|
|
diff -b $BASEDIR/hlsl.reflection.binding.frag.out $TARGETDIR/hlsl.reflection.binding.frag.out || HASERROR=1
|
2020-07-14 11:56:26 +00:00
|
|
|
run -D -Od -e main -l -q --hlsl-iomap --auto-map-bindings --stb 10 --sbb 20 --ssb 30 --suavb 40 --scb 50 -D -V -e main -Od hlsl.automap.frag > $TARGETDIR/hlsl.automap.frag.out
|
2017-04-18 18:18:01 +00:00
|
|
|
diff -b $BASEDIR/hlsl.automap.frag.out $TARGETDIR/hlsl.automap.frag.out || HASERROR=1
|
2013-11-07 01:06:34 +00:00
|
|
|
|
2013-09-06 19:52:57 +00:00
|
|
|
#
|
|
|
|
# multi-threaded test
|
|
|
|
#
|
|
|
|
echo Comparing single thread to multithread for all tests in current directory...
|
2020-07-14 11:56:26 +00:00
|
|
|
run -i -C *.vert *.geom *.frag *.tesc *.tese *.comp > $TARGETDIR/singleThread.out
|
|
|
|
run -i -C *.vert *.geom *.frag *.tesc *.tese *.comp -t > $TARGETDIR/multiThread.out
|
2019-10-15 20:47:28 +00:00
|
|
|
diff $TARGETDIR/singleThread.out $TARGETDIR/multiThread.out || HASERROR=1
|
2017-07-06 17:58:12 +00:00
|
|
|
if [ $HASERROR -eq 0 ]
|
|
|
|
then
|
2019-10-15 20:47:28 +00:00
|
|
|
rm $TARGETDIR/singleThread.out
|
|
|
|
rm $TARGETDIR/multiThread.out
|
2017-07-06 17:58:12 +00:00
|
|
|
fi
|
2015-05-15 19:01:17 +00:00
|
|
|
|
2016-10-31 21:13:43 +00:00
|
|
|
#
|
|
|
|
# entry point renaming tests
|
|
|
|
#
|
2016-12-10 02:22:20 +00:00
|
|
|
echo Running entry-point renaming tests
|
2020-07-14 11:56:26 +00:00
|
|
|
run -i -H -V -D -Od --entry-point main_in_spv --ku --source-entrypoint main -Od hlsl.entry.rename.frag > $TARGETDIR/hlsl.entry.rename.frag.out
|
2016-10-31 21:13:43 +00:00
|
|
|
diff -b $BASEDIR/hlsl.entry.rename.frag.out $TARGETDIR/hlsl.entry.rename.frag.out || HASERROR=1
|
|
|
|
|
2016-12-10 02:22:20 +00:00
|
|
|
#
|
|
|
|
# Testing ill-defined uncalled function
|
|
|
|
#
|
|
|
|
echo Running ill-defined uncalled function
|
2020-07-14 11:56:26 +00:00
|
|
|
run -D -Od -e main -H -Od hlsl.deadFunctionMissingBody.vert > $TARGETDIR/hlsl.deadFunctionMissingBody.vert.out
|
2016-12-10 02:22:20 +00:00
|
|
|
diff -b $BASEDIR/hlsl.deadFunctionMissingBody.vert.out $TARGETDIR/hlsl.deadFunctionMissingBody.vert.out || HASERROR=1
|
|
|
|
|
2015-05-15 21:54:24 +00:00
|
|
|
if [ $HASERROR -eq 0 ]
|
|
|
|
then
|
|
|
|
echo Tests Succeeded.
|
|
|
|
else
|
|
|
|
echo Tests Failed.
|
|
|
|
fi
|
|
|
|
|
2017-03-16 17:20:38 +00:00
|
|
|
#
|
2018-04-17 23:44:11 +00:00
|
|
|
# Testing -S and compound suffixes
|
2017-03-16 17:20:38 +00:00
|
|
|
#
|
2018-04-17 23:44:11 +00:00
|
|
|
echo Running explicit stage test and compound suffix tests
|
2020-07-14 11:56:26 +00:00
|
|
|
run -Od -i -S vert nosuffix > $TARGETDIR/nosuffix.out
|
2017-03-16 17:20:38 +00:00
|
|
|
diff -b $BASEDIR/nosuffix.out $TARGETDIR/nosuffix.out || HASERROR=1
|
2020-07-14 11:56:26 +00:00
|
|
|
run -Od -i compoundsuffix.vert.glsl > $TARGETDIR/compoundsuffix.vert.glsl
|
2018-04-17 23:44:11 +00:00
|
|
|
diff -b $BASEDIR/compoundsuffix.vert.glsl $TARGETDIR/compoundsuffix.vert.glsl || HASERROR=1
|
2020-07-14 11:56:26 +00:00
|
|
|
run -Od -e main -H compoundsuffix.frag.hlsl > $TARGETDIR/compoundsuffix.frag.hlsl
|
2018-04-17 23:44:11 +00:00
|
|
|
diff -b $BASEDIR/compoundsuffix.frag.hlsl $TARGETDIR/compoundsuffix.frag.hlsl || HASERROR=1
|
2017-03-16 17:20:38 +00:00
|
|
|
|
2017-04-05 23:38:20 +00:00
|
|
|
#
|
|
|
|
# Testing --hlsl-offsets
|
|
|
|
#
|
|
|
|
echo Running hlsl offsets
|
2020-07-14 11:56:26 +00:00
|
|
|
run -i --hlsl-offsets -H spv.hlslOffsets.vert > $TARGETDIR/spv.hlslOffsets.vert.out
|
2017-04-05 23:38:20 +00:00
|
|
|
diff -b $BASEDIR/spv.hlslOffsets.vert.out $TARGETDIR/spv.hlslOffsets.vert.out || HASERROR=1
|
|
|
|
|
|
|
|
echo Running hlsl offsets
|
2020-07-14 11:56:26 +00:00
|
|
|
run -i --hlsl-offsets -D -Od -e main -H -Od hlsl.hlslOffset.vert > $TARGETDIR/hlsl.hlslOffset.vert.out
|
2017-04-05 23:38:20 +00:00
|
|
|
diff -b $BASEDIR/hlsl.hlslOffset.vert.out $TARGETDIR/hlsl.hlslOffset.vert.out || HASERROR=1
|
|
|
|
|
2017-05-02 07:27:29 +00:00
|
|
|
#
|
2017-05-18 00:28:19 +00:00
|
|
|
# Testing --resource-set-binding
|
2017-05-02 07:27:29 +00:00
|
|
|
#
|
|
|
|
echo Configuring HLSL descriptor set and binding number manually
|
2020-07-14 11:56:26 +00:00
|
|
|
run -V -D -Od -e main -H -Od hlsl.multiDescriptorSet.frag --rsb frag t0 0 0 t1 1 0 s0 0 1 s1 1 1 b0 2 0 b1 2 1 b2 2 2 > $TARGETDIR/hlsl.multiDescriptorSet.frag.out
|
2017-05-31 23:11:16 +00:00
|
|
|
diff -b $BASEDIR/hlsl.multiDescriptorSet.frag.out $TARGETDIR/hlsl.multiDescriptorSet.frag.out || HASERROR=1
|
2017-05-02 07:27:29 +00:00
|
|
|
|
2020-07-14 11:56:26 +00:00
|
|
|
run -V -D -Od -e main -H -Od hlsl.explicitDescriptorSet.frag --hlsl-iomap --amb --ssb 10 --stb 20 --rsb 4 > $TARGETDIR/hlsl.explicitDescriptorSet.frag.out
|
2017-07-14 21:15:47 +00:00
|
|
|
diff -b $BASEDIR/hlsl.explicitDescriptorSet.frag.out $TARGETDIR/hlsl.explicitDescriptorSet.frag.out || HASERROR=1
|
|
|
|
|
2020-07-14 11:56:26 +00:00
|
|
|
run -V -D -Od -e main -H -Od hlsl.explicitDescriptorSet.frag --hlsl-iomap --amb --ssb 10 --stb 20 --rsb frag 3 > $TARGETDIR/hlsl.explicitDescriptorSet-2.frag.out
|
2017-07-14 21:15:47 +00:00
|
|
|
diff -b $BASEDIR/hlsl.explicitDescriptorSet-2.frag.out $TARGETDIR/hlsl.explicitDescriptorSet-2.frag.out || HASERROR=1
|
|
|
|
|
Add per-descriptor-set IO mapping shift values.
This PR adds the ability to provide per-descriptor-set IO mapping shift
values. If a particular binding does not land into a per-set value,
then it falls back to the prior behavior (global shifts per resource class).
Because there were already 6 copies of many different methods and internal
variables and functions, and this PR would have added 6 more, a new API is
introduced to cut down on replication and present a cleaner interface.
For the global (non-set-specific) API, the old entry points still exist
for backward compatibility, but are phrased internally in terms of the
following.
// Resource type for IO resolver
enum TResourceType {
EResSampler,
EResTexture,
EResImage,
EResUbo,
EResSsbo,
EResUav,
EResCount
};
Methods on TShader:
void setShiftBinding(TResourceType res, unsigned int base);
void setShiftBindingForSet(TResourceType res, unsigned int set, unsigned int base);
The first method replaces the 6 prior entry points of various spellings, which
exist now in depreciated form. The second provides per-resource-set functionality.
Both accept an enum from the list above.
From the command line, the existing options can accept either a single shift value as
before, or a series of 1 or more [set offset] pairs. Both can be provided, as in:
... --stb 20 --stb 2 25 3 30 ...
which will use the offset 20 for anything except descriptor set 2 (which uses 25) and
3 (which uses 30).
2017-10-18 01:27:14 +00:00
|
|
|
#
|
|
|
|
# Testing per-descriptor-set IO map shift
|
|
|
|
#
|
|
|
|
echo 'Testing per-descriptor-set IO map shift'
|
2020-07-14 11:56:26 +00:00
|
|
|
run -e main --hlsl-iomap --ssb 10 1 15 2 --stb 20 --stb 25 2 --stb 70 6 --suavb 30 --suavb 40 2 --sub 50 6 -i -q -D -Od -V hlsl.shift.per-set.frag > $TARGETDIR/hlsl.shift.per-set.frag.out || HASERROR=1
|
Add per-descriptor-set IO mapping shift values.
This PR adds the ability to provide per-descriptor-set IO mapping shift
values. If a particular binding does not land into a per-set value,
then it falls back to the prior behavior (global shifts per resource class).
Because there were already 6 copies of many different methods and internal
variables and functions, and this PR would have added 6 more, a new API is
introduced to cut down on replication and present a cleaner interface.
For the global (non-set-specific) API, the old entry points still exist
for backward compatibility, but are phrased internally in terms of the
following.
// Resource type for IO resolver
enum TResourceType {
EResSampler,
EResTexture,
EResImage,
EResUbo,
EResSsbo,
EResUav,
EResCount
};
Methods on TShader:
void setShiftBinding(TResourceType res, unsigned int base);
void setShiftBindingForSet(TResourceType res, unsigned int set, unsigned int base);
The first method replaces the 6 prior entry points of various spellings, which
exist now in depreciated form. The second provides per-resource-set functionality.
Both accept an enum from the list above.
From the command line, the existing options can accept either a single shift value as
before, or a series of 1 or more [set offset] pairs. Both can be provided, as in:
... --stb 20 --stb 2 25 3 30 ...
which will use the offset 20 for anything except descriptor set 2 (which uses 25) and
3 (which uses 30).
2017-10-18 01:27:14 +00:00
|
|
|
diff -b $BASEDIR/hlsl.shift.per-set.frag.out $TARGETDIR/hlsl.shift.per-set.frag.out || HASERROR=1
|
|
|
|
|
2017-05-18 00:28:19 +00:00
|
|
|
#
|
|
|
|
# Testing location error
|
|
|
|
#
|
|
|
|
echo Testing SPV no location
|
2020-07-14 11:56:26 +00:00
|
|
|
run -V -C spv.noLocation.vert > $TARGETDIR/spv.noLocation.vert.out
|
2017-05-31 23:11:16 +00:00
|
|
|
diff -b $BASEDIR/spv.noLocation.vert.out $TARGETDIR/spv.noLocation.vert.out || HASERROR=1
|
2020-07-14 11:56:26 +00:00
|
|
|
run -G -H --aml spv.noBuiltInLoc.vert > $TARGETDIR/spv.noBuiltInLoc.vert.out
|
2017-07-14 11:52:31 +00:00
|
|
|
diff -b $BASEDIR/spv.noBuiltInLoc.vert.out $TARGETDIR/spv.noBuiltInLoc.vert.out || HASERROR=1
|
2020-07-14 11:56:26 +00:00
|
|
|
run -G spv.looseUniformNoLoc.vert > $TARGETDIR/spv.looseUniformNoLoc.vert.out
|
2017-08-26 21:47:25 +00:00
|
|
|
diff -b $BASEDIR/spv.looseUniformNoLoc.vert.out $TARGETDIR/spv.looseUniformNoLoc.vert.out || HASERROR=1
|
2017-05-31 23:11:16 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Testing debug information
|
|
|
|
#
|
|
|
|
echo Testing SPV Debug Information
|
2020-07-14 11:56:26 +00:00
|
|
|
run -g --relaxed-errors --suppress-warnings --aml --amb --hlsl-offsets --nsf --spirv-val \
|
2017-07-21 02:00:36 +00:00
|
|
|
-G -H spv.debugInfo.frag --rsb frag 3 > $TARGETDIR/spv.debugInfo.frag.out
|
2017-05-31 23:11:16 +00:00
|
|
|
diff -b $BASEDIR/spv.debugInfo.frag.out $TARGETDIR/spv.debugInfo.frag.out || HASERROR=1
|
2020-07-14 11:56:26 +00:00
|
|
|
run -g -Od --target-env vulkan1.1 --relaxed-errors --suppress-warnings --aml --amb --hlsl-offsets --nsf --spirv-val \
|
2021-01-05 18:21:20 +00:00
|
|
|
-V -H spv.debugInfo.frag --rsb frag 3 > $TARGETDIR/spv.debugInfo.1.1.frag.out
|
2018-03-06 23:12:04 +00:00
|
|
|
diff -b $BASEDIR/spv.debugInfo.1.1.frag.out $TARGETDIR/spv.debugInfo.1.1.frag.out || HASERROR=1
|
2020-07-14 11:56:26 +00:00
|
|
|
run -g -D -Od -e newMain -g --amb --aml --fua --hlsl-iomap --nsf --spirv-val --sib 1 --ssb 2 --sbb 3 --stb 4 --suavb 5 --sub 6 \
|
2017-09-22 00:40:22 +00:00
|
|
|
--sep origMain -H -Od spv.hlslDebugInfo.vert --rsb vert t0 0 0 > $TARGETDIR/spv.hlslDebugInfo.frag.out
|
2017-07-21 02:00:36 +00:00
|
|
|
diff -b $BASEDIR/spv.hlslDebugInfo.frag.out $TARGETDIR/spv.hlslDebugInfo.frag.out || HASERROR=1
|
2017-05-18 00:28:19 +00:00
|
|
|
|
2017-05-22 21:00:42 +00:00
|
|
|
#
|
|
|
|
# Testing Includer
|
|
|
|
#
|
|
|
|
echo Testing Includer
|
2020-07-14 11:56:26 +00:00
|
|
|
run -D -Od -e main -H -Od ../Test/hlsl.include.vert > $TARGETDIR/hlsl.include.vert.out
|
2017-05-22 21:00:42 +00:00
|
|
|
diff -b $BASEDIR/hlsl.include.vert.out $TARGETDIR/hlsl.include.vert.out || HASERROR=1
|
2020-07-14 11:56:26 +00:00
|
|
|
run -D -Od -e main -H -Od hlsl.includeNegative.vert > $TARGETDIR/hlsl.includeNegative.vert.out
|
2017-05-22 21:00:42 +00:00
|
|
|
diff -b $BASEDIR/hlsl.includeNegative.vert.out $TARGETDIR/hlsl.includeNegative.vert.out || HASERROR=1
|
2020-07-14 11:56:26 +00:00
|
|
|
run -l -i include.vert > $TARGETDIR/include.vert.out
|
2017-05-22 21:00:42 +00:00
|
|
|
diff -b $BASEDIR/include.vert.out $TARGETDIR/include.vert.out || HASERROR=1
|
2020-07-14 11:56:26 +00:00
|
|
|
run -D -Od -e main -H -Od -Iinc1/path1 -Iinc1/path2 hlsl.dashI.vert > $TARGETDIR/hlsl.dashI.vert.out
|
2017-06-07 21:06:58 +00:00
|
|
|
diff -b $BASEDIR/hlsl.dashI.vert.out $TARGETDIR/hlsl.dashI.vert.out || HASERROR=1
|
2020-07-14 11:56:26 +00:00
|
|
|
run -D -Od -e MainPs -H -Od -g hlsl.pp.line3.frag > $TARGETDIR/hlsl.pp.line3.frag.out
|
2018-12-08 00:36:33 +00:00
|
|
|
diff -b $BASEDIR/hlsl.pp.line3.frag.out $TARGETDIR/hlsl.pp.line3.frag.out || HASERROR=1
|
2017-05-22 21:00:42 +00:00
|
|
|
|
2021-04-20 16:12:39 +00:00
|
|
|
#
|
|
|
|
# Testing --depfile
|
|
|
|
#
|
|
|
|
|
|
|
|
echo "Testing --depfile"
|
|
|
|
run -D -Od -e main -H --depfile $TARGETDIR/hlsl.include.vert.d.out -Od ../Test/hlsl.include.vert > $TARGETDIR/hlsl.include.vert.out
|
|
|
|
diff -b $BASEDIR/hlsl.include.vert.d.out $TARGETDIR/hlsl.include.vert.d.out || HASERROR=1
|
|
|
|
run -D -Od -e main -H --depfile $TARGETDIR/hlsl.dashI.vert.d.out -Od -Iinc1/path1 -Iinc1/path2 hlsl.dashI.vert > $TARGETDIR/hlsl.dashI.vert.out
|
|
|
|
diff -b $BASEDIR/hlsl.dashI.vert.d.out $TARGETDIR/hlsl.dashI.vert.d.out || HASERROR=1
|
|
|
|
|
2017-06-15 16:40:49 +00:00
|
|
|
#
|
|
|
|
# Testing -D and -U
|
|
|
|
#
|
2017-09-17 16:38:52 +00:00
|
|
|
echo "Testing -D and -U"
|
2020-07-14 11:56:26 +00:00
|
|
|
run -DUNDEFED -UIN_SHADER -DFOO=200 -i -l --U UNDEFED --define-macro MUL=FOO*2 glsl.-D-U.frag > $TARGETDIR/glsl.-D-U.frag.out
|
2017-06-15 16:40:49 +00:00
|
|
|
diff -b $BASEDIR/glsl.-D-U.frag.out $TARGETDIR/glsl.-D-U.frag.out || HASERROR=1
|
2020-07-14 11:56:26 +00:00
|
|
|
run -D -Od -e main -V -i -DUNDEFED -UIN_SHADER --D FOO=200 --undef-macro UNDEFED -Od hlsl.-D-U.frag > $TARGETDIR/hlsl.-D-U.frag.out
|
2017-06-15 16:40:49 +00:00
|
|
|
diff -b $BASEDIR/hlsl.-D-U.frag.out $TARGETDIR/hlsl.-D-U.frag.out || HASERROR=1
|
|
|
|
|
2017-06-23 17:11:09 +00:00
|
|
|
#
|
|
|
|
# Test --client and --target-env
|
|
|
|
#
|
2017-09-17 16:38:52 +00:00
|
|
|
echo "Testing --client and --target-env"
|
2020-07-14 11:56:26 +00:00
|
|
|
run --client vulkan100 spv.targetVulkan.vert || HASERROR=1
|
|
|
|
run --client opengl100 spv.targetOpenGL.vert || HASERROR=1
|
|
|
|
run --target-env vulkan1.0 spv.targetVulkan.vert || HASERROR=1
|
|
|
|
run --target-env vulkan1.1 spv.targetVulkan.vert || HASERROR=1
|
|
|
|
run --target-env vulkan1.2 spv.targetVulkan.vert || HASERROR=1
|
|
|
|
run --target-env opengl spv.targetOpenGL.vert || HASERROR=1
|
|
|
|
run -V100 spv.targetVulkan.vert || HASERROR=1
|
|
|
|
run -G100 spv.targetOpenGL.vert || HASERROR=1
|
|
|
|
run --target-env spirv1.2 -V spv.targetVulkan.vert || HASERROR=1
|
2017-06-23 17:11:09 +00:00
|
|
|
|
2017-09-12 03:48:19 +00:00
|
|
|
#
|
|
|
|
# Testing GLSL entry point rename
|
|
|
|
#
|
2017-09-17 16:38:52 +00:00
|
|
|
echo "Testing GLSL entry point rename"
|
2020-07-14 11:56:26 +00:00
|
|
|
run -H -e foo --source-entrypoint main glsl.entryPointRename.vert > $TARGETDIR/glsl.entryPointRename.vert.out
|
2017-09-12 03:48:19 +00:00
|
|
|
diff -b $BASEDIR/glsl.entryPointRename.vert.out $TARGETDIR/glsl.entryPointRename.vert.out || HASERROR=1
|
2020-07-14 11:56:26 +00:00
|
|
|
run -H -e foo --source-entrypoint bar glsl.entryPointRename.vert > $TARGETDIR/glsl.entryPointRename.vert.bad.out
|
2017-09-12 03:48:19 +00:00
|
|
|
diff -b $BASEDIR/glsl.entryPointRename.vert.bad.out $TARGETDIR/glsl.entryPointRename.vert.bad.out || HASERROR=1
|
2020-07-14 11:56:26 +00:00
|
|
|
run -H -e foo --source-entrypoint main glsl.entryPointRename2.vert > $TARGETDIR/glsl.entryPointRename2.vert.out
|
2017-09-12 03:48:19 +00:00
|
|
|
diff -b $BASEDIR/glsl.entryPointRename2.vert.out $TARGETDIR/glsl.entryPointRename2.vert.out || HASERROR=1
|
|
|
|
|
2017-09-17 16:38:52 +00:00
|
|
|
#
|
|
|
|
# Testing remapper error handling
|
|
|
|
#
|
|
|
|
echo "Testing remapper error handling"
|
|
|
|
$REMAPEXE --do-everything -i remap.invalid-spirv-1.spv -o $TARGETDIR > $TARGETDIR/remap.invalid-spirv-1.out && HASERROR=1
|
|
|
|
diff -b $BASEDIR/remap.invalid-spirv-1.out $TARGETDIR/remap.invalid-spirv-1.out || HASERROR=1
|
|
|
|
$REMAPEXE --do-everything -i remap.invalid-spirv-2.spv -o $TARGETDIR > $TARGETDIR/remap.invalid-spirv-2.out && HASERROR=1
|
|
|
|
diff -b $BASEDIR/remap.invalid-spirv-2.out $TARGETDIR/remap.invalid-spirv-2.out || HASERROR=1
|
|
|
|
|
2017-12-06 23:52:03 +00:00
|
|
|
#
|
|
|
|
# Testing position Y inversion
|
|
|
|
#
|
|
|
|
echo "Testing position Y inversion"
|
2020-07-14 11:56:26 +00:00
|
|
|
run -H -e main -V -D -Od -H -i --iy hlsl.y-negate-1.vert > $TARGETDIR/hlsl.y-negate-1.vert.out
|
2017-12-06 23:52:03 +00:00
|
|
|
diff -b $BASEDIR/hlsl.y-negate-1.vert.out $TARGETDIR/hlsl.y-negate-1.vert.out || HASERROR=1
|
2020-07-14 11:56:26 +00:00
|
|
|
run -H -e main -V -D -Od -H -i --invert-y hlsl.y-negate-2.vert > $TARGETDIR/hlsl.y-negate-2.vert.out
|
2017-12-06 23:52:03 +00:00
|
|
|
diff -b $BASEDIR/hlsl.y-negate-2.vert.out $TARGETDIR/hlsl.y-negate-2.vert.out || HASERROR=1
|
2020-07-14 11:56:26 +00:00
|
|
|
run -H -e main -V -D -Od -H -i --invert-y hlsl.y-negate-3.vert > $TARGETDIR/hlsl.y-negate-3.vert.out
|
2017-12-06 23:52:03 +00:00
|
|
|
diff -b $BASEDIR/hlsl.y-negate-3.vert.out $TARGETDIR/hlsl.y-negate-3.vert.out || HASERROR=1
|
|
|
|
|
2021-11-17 01:42:12 +00:00
|
|
|
#
|
|
|
|
# Testing position W reciprocal
|
|
|
|
#
|
|
|
|
echo "Testing position W reciprocal"
|
|
|
|
run -H -e main -V -D -Od -H -i --hlsl-dx-position-w hlsl.w-recip.frag > $TARGETDIR/hlsl.w-recip.frag.out
|
|
|
|
diff -b $BASEDIR/hlsl.w-recip.frag.out $TARGETDIR/hlsl.w-recip.frag.out || HASERROR=1
|
2021-12-07 21:33:09 +00:00
|
|
|
run -H -e main -V -D -Od -H -i --hlsl-dx-position-w hlsl.w-recip2.frag > $TARGETDIR/hlsl.w-recip2.frag.out
|
|
|
|
diff -b $BASEDIR/hlsl.w-recip2.frag.out $TARGETDIR/hlsl.w-recip2.frag.out || HASERROR=1
|
2021-11-17 01:42:12 +00:00
|
|
|
|
2018-03-08 01:05:55 +00:00
|
|
|
#
|
|
|
|
# Testing hlsl_functionality1
|
|
|
|
#
|
2018-10-25 18:43:02 +00:00
|
|
|
echo "Testing hlsl_functionality1"
|
2020-07-14 11:56:26 +00:00
|
|
|
run -H -e main -D -Od -fhlsl_functionality1 hlsl.structbuffer.incdec.frag > \
|
2018-03-08 01:05:55 +00:00
|
|
|
$TARGETDIR/hlsl.structbuffer.incdec.frag.hlslfun1.out
|
|
|
|
diff -b $BASEDIR/hlsl.structbuffer.incdec.frag.hlslfun1.out $TARGETDIR/hlsl.structbuffer.incdec.frag.hlslfun1.out || HASERROR=1
|
2020-07-14 11:56:26 +00:00
|
|
|
run -H -e main -D -Od -fhlsl_functionality1 hlsl.noSemantic.functionality1.comp > \
|
2018-04-06 01:35:38 +00:00
|
|
|
$TARGETDIR/hlsl.noSemantic.functionality1.comp.out
|
|
|
|
diff -b $BASEDIR/hlsl.noSemantic.functionality1.comp.out $TARGETDIR/hlsl.noSemantic.functionality1.comp.out || HASERROR=1
|
2018-03-08 01:05:55 +00:00
|
|
|
|
2018-07-02 16:40:32 +00:00
|
|
|
#
|
|
|
|
# Testing HLSL-specific PP feature expansion
|
|
|
|
#
|
2018-10-25 18:43:02 +00:00
|
|
|
echo "Testing HLSL-specific PP feature expansion"
|
2020-07-14 11:56:26 +00:00
|
|
|
run -D -E hlsl.pp.expand.frag > $TARGETDIR/hlsl.pp.expand.frag.out 2> $TARGETDIR/hlsl.pp.expand.frag.err
|
2018-07-02 16:40:32 +00:00
|
|
|
diff -b $BASEDIR/hlsl.pp.expand.frag.out $TARGETDIR/hlsl.pp.expand.frag.out || HASERROR=1
|
|
|
|
diff -b $BASEDIR/hlsl.pp.expand.frag.err $TARGETDIR/hlsl.pp.expand.frag.err || HASERROR=1
|
|
|
|
|
2019-06-18 05:33:09 +00:00
|
|
|
#
|
|
|
|
# Test --nan-clamp
|
|
|
|
#
|
|
|
|
echo "Testing nan-clamp"
|
2020-07-14 11:56:26 +00:00
|
|
|
run --nan-clamp -H --aml --amb spv.400.frag > $TARGETDIR/spv.400.frag.nanclamp.out
|
2019-06-18 05:33:09 +00:00
|
|
|
diff -b $BASEDIR/spv.400.frag.nanclamp.out $TARGETDIR/spv.400.frag.nanclamp.out || HASERROR=1
|
|
|
|
|
2021-04-22 11:13:38 +00:00
|
|
|
#
|
|
|
|
# Test --auto-sampled-textures
|
|
|
|
#
|
|
|
|
echo "Testing auto-sampled-textures"
|
|
|
|
run --auto-sampled-textures -H -Od -e MainPs -D -S frag hlsl.autosampledtextures.frag > $TARGETDIR/hlsl.autosampledtextures.frag.out
|
|
|
|
diff -b $BASEDIR/hlsl.autosampledtextures.frag.out $TARGETDIR/hlsl.autosampledtextures.frag.out || HASERROR=1
|
|
|
|
run --auto-sampled-textures -H -Od -S frag glsl.autosampledtextures.frag > $TARGETDIR/glsl.autosampledtextures.frag.out
|
|
|
|
diff -b $BASEDIR/glsl.autosampledtextures.frag.out $TARGETDIR/glsl.autosampledtextures.frag.out || HASERROR=1
|
|
|
|
|
2022-01-10 14:43:44 +00:00
|
|
|
# Test --glsl-version
|
|
|
|
#
|
|
|
|
echo "Testing --glsl-version"
|
|
|
|
run --glsl-version 410 -V -S vert glsl.versionOverride.vert > $TARGETDIR/glsl.versionOverride.vert.out
|
|
|
|
diff -b $BASEDIR/glsl.versionOverride.vert.out $TARGETDIR/glsl.versionOverride.vert.out || HASERROR=1
|
|
|
|
run --glsl-version 420 -V -S frag glsl.versionOverride.frag > $TARGETDIR/glsl.versionOverride.frag.out
|
|
|
|
diff -b $BASEDIR/glsl.versionOverride.frag.out $TARGETDIR/glsl.versionOverride.frag.out || HASERROR=1
|
|
|
|
run --glsl-version 430 -V -S geom glsl.versionOverride.geom > $TARGETDIR/glsl.versionOverride.geom.out
|
|
|
|
diff -b $BASEDIR/glsl.versionOverride.geom.out $TARGETDIR/glsl.versionOverride.geom.out || HASERROR=1
|
|
|
|
run --glsl-version 440 -V -S tesc glsl.versionOverride.tesc > $TARGETDIR/glsl.versionOverride.tesc.out
|
|
|
|
diff -b $BASEDIR/glsl.versionOverride.tesc.out $TARGETDIR/glsl.versionOverride.tesc.out || HASERROR=1
|
|
|
|
run --glsl-version 450 -V -S tese glsl.versionOverride.tese > $TARGETDIR/glsl.versionOverride.tese.out
|
|
|
|
diff -b $BASEDIR/glsl.versionOverride.tese.out $TARGETDIR/glsl.versionOverride.tese.out || HASERROR=1
|
|
|
|
run --glsl-version 460 -V -S comp glsl.versionOverride.comp > $TARGETDIR/glsl.versionOverride.comp.out
|
|
|
|
diff -b $BASEDIR/glsl.versionOverride.comp.out $TARGETDIR/glsl.versionOverride.comp.out || HASERROR=1
|
|
|
|
|
2017-04-05 23:38:20 +00:00
|
|
|
#
|
|
|
|
# Final checking
|
|
|
|
#
|
2017-03-16 17:20:38 +00:00
|
|
|
if [ $HASERROR -eq 0 ]
|
|
|
|
then
|
|
|
|
echo Tests Succeeded.
|
|
|
|
else
|
|
|
|
echo Tests Failed.
|
|
|
|
fi
|
|
|
|
|
2017-07-06 17:58:12 +00:00
|
|
|
rm -f comp.spv frag.spv geom.spv tesc.spv tese.spv vert.spv
|
|
|
|
|
2015-05-15 19:01:17 +00:00
|
|
|
exit $HASERROR
|