John Kessenich | aab2514 | 2013-02-12 18:26:15 +0000 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
Dan Sinclair | 3290d38 | 2019-10-16 13:08:48 -0400 | [diff] [blame] | 3 | # Arguments: |
| 4 | # 1- TargetDirectory, where to write test results and intermediary files |
| 5 | # 2- Path to glslangValidator |
| 6 | # 3- Path to spirv-remap |
| 7 | |
| 8 | TARGETDIR=${1:-localResults} |
John Kessenich | 4586dbd | 2013-08-05 15:52:03 +0000 | [diff] [blame] | 9 | BASEDIR=baseResults |
Dan Sinclair | 3290d38 | 2019-10-16 13:08:48 -0400 | [diff] [blame] | 10 | EXE=${2:-../build/install/bin/glslangValidator} |
| 11 | REMAPEXE=${3:-../build/install/bin/spirv-remap} |
John Kessenich | b38c969 | 2015-05-15 19:01:17 +0000 | [diff] [blame] | 12 | HASERROR=0 |
Dan Sinclair | 3f072e1 | 2019-10-15 16:47:28 -0400 | [diff] [blame] | 13 | mkdir -p $TARGETDIR |
John Kessenich | 69f4b51 | 2013-09-04 21:19:27 +0000 | [diff] [blame] | 14 | |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 15 | LIBPATH="$(cd "$(dirname "$(dirname $EXE)")" && pwd)/lib" |
| 16 | if [ -d "${LIBPATH}" ]; then |
| 17 | export LD_LIBRARY_PATH="${LIBPATH}:${LD_LIBRARY_PATH}" |
| 18 | fi |
| 19 | |
| 20 | function run { |
| 21 | $EXE $@ |
| 22 | result=$? |
| 23 | case "$result" in |
| 24 | [0-6]) # Valid success and error codes |
| 25 | return |
| 26 | ;; |
| 27 | *) |
| 28 | echo "$EXE returned $result" |
| 29 | HASERROR=1 |
| 30 | esac |
| 31 | } |
| 32 | |
John Kessenich | cf0206c | 2014-04-14 15:46:40 +0000 | [diff] [blame] | 33 | if [ -a localtestlist ] |
| 34 | then |
| 35 | while read t; do |
| 36 | echo Running $t... |
| 37 | b=`basename $t` |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 38 | run -i -l $t > $TARGETDIR/$b.out |
John Kessenich | b38c969 | 2015-05-15 19:01:17 +0000 | [diff] [blame] | 39 | diff -b $BASEDIR/$b.out $TARGETDIR/$b.out || HASERROR=1 |
John Kessenich | cf0206c | 2014-04-14 15:46:40 +0000 | [diff] [blame] | 40 | done < localtestlist |
| 41 | fi |
| 42 | |
johnkslang | 02ad18a | 2015-06-26 00:12:31 -0600 | [diff] [blame] | 43 | rm -f comp.spv frag.spv geom.spv tesc.spv tese.spv vert.spv |
John Kessenich | 593a3f7 | 2015-05-15 18:44:16 +0000 | [diff] [blame] | 44 | |
| 45 | # |
John Kessenich | 31a51be | 2016-07-19 14:32:52 -0600 | [diff] [blame] | 46 | # special tests |
| 47 | # |
| 48 | |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 49 | run badMacroArgs.frag > $TARGETDIR/badMacroArgs.frag.out |
John Kessenich | 31a51be | 2016-07-19 14:32:52 -0600 | [diff] [blame] | 50 | diff -b $BASEDIR/badMacroArgs.frag.out $TARGETDIR/badMacroArgs.frag.out || HASERROR=1 |
| 51 | |
| 52 | # |
John Kessenich | 11f9fc7 | 2013-11-07 01:06:34 +0000 | [diff] [blame] | 53 | # reflection tests |
| 54 | # |
| 55 | echo Running reflection... |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 56 | run -l -q -C reflection.vert > $TARGETDIR/reflection.vert.out |
John Kessenich | b38c969 | 2015-05-15 19:01:17 +0000 | [diff] [blame] | 57 | diff -b $BASEDIR/reflection.vert.out $TARGETDIR/reflection.vert.out || HASERROR=1 |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 58 | 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 |
baldurk | 15c37f7 | 2019-01-29 12:12:59 +0000 | [diff] [blame] | 59 | diff -b $BASEDIR/reflection.options.vert.out $TARGETDIR/reflection.options.vert.out || HASERROR=1 |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 60 | run -l -q -C reflection.frag > $TARGETDIR/reflection.frag.out |
baldurk | 0af5e3e | 2019-01-29 16:04:44 +0000 | [diff] [blame] | 61 | diff -b $BASEDIR/reflection.frag.out $TARGETDIR/reflection.frag.out || HASERROR=1 |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 62 | 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 |
baldurk | 0af5e3e | 2019-01-29 16:04:44 +0000 | [diff] [blame] | 63 | diff -b $BASEDIR/reflection.options.frag.out $TARGETDIR/reflection.options.frag.out || HASERROR=1 |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 64 | 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 |
baldurk | 1905069 | 2019-02-11 11:50:24 +0000 | [diff] [blame] | 65 | diff -b $BASEDIR/reflection.options.geom.out $TARGETDIR/reflection.options.geom.out || HASERROR=1 |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 66 | run -l -q -C reflection.linked.vert reflection.linked.frag > $TARGETDIR/reflection.linked.out |
baldurk | a972e73 | 2019-01-30 15:34:02 +0000 | [diff] [blame] | 67 | diff -b $BASEDIR/reflection.linked.out $TARGETDIR/reflection.linked.out || HASERROR=1 |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 68 | 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 |
baldurk | a972e73 | 2019-01-30 15:34:02 +0000 | [diff] [blame] | 69 | diff -b $BASEDIR/reflection.linked.options.out $TARGETDIR/reflection.linked.options.out || HASERROR=1 |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 70 | run -D -Od -e flizv -l -q -C -V -Od hlsl.reflection.vert > $TARGETDIR/hlsl.reflection.vert.out |
John Kessenich | 2572b19 | 2016-09-19 23:12:48 -0600 | [diff] [blame] | 71 | diff -b $BASEDIR/hlsl.reflection.vert.out $TARGETDIR/hlsl.reflection.vert.out || HASERROR=1 |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 72 | run -D -Od -e main -l -q -C -V -Od hlsl.reflection.binding.frag > $TARGETDIR/hlsl.reflection.binding.frag.out |
steve-lunarg | 8ffc36a | 2016-09-21 14:19:40 -0600 | [diff] [blame] | 73 | diff -b $BASEDIR/hlsl.reflection.binding.frag.out $TARGETDIR/hlsl.reflection.binding.frag.out || HASERROR=1 |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 74 | 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 |
steve-lunarg | be28355 | 2017-04-18 12:18:01 -0600 | [diff] [blame] | 75 | diff -b $BASEDIR/hlsl.automap.frag.out $TARGETDIR/hlsl.automap.frag.out || HASERROR=1 |
John Kessenich | 11f9fc7 | 2013-11-07 01:06:34 +0000 | [diff] [blame] | 76 | |
| 77 | # |
John Kessenich | 38f3b89 | 2013-09-06 19:52:57 +0000 | [diff] [blame] | 78 | # multi-threaded test |
| 79 | # |
John Kessenich | 38f3b89 | 2013-09-06 19:52:57 +0000 | [diff] [blame] | 80 | echo Comparing single thread to multithread for all tests in current directory... |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 81 | run -i -C *.vert *.geom *.frag *.tesc *.tese *.comp > $TARGETDIR/singleThread.out |
| 82 | run -i -C *.vert *.geom *.frag *.tesc *.tese *.comp -t > $TARGETDIR/multiThread.out |
Dan Sinclair | 3f072e1 | 2019-10-15 16:47:28 -0400 | [diff] [blame] | 83 | diff $TARGETDIR/singleThread.out $TARGETDIR/multiThread.out || HASERROR=1 |
John Kessenich | 4b1a890 | 2017-07-06 11:58:12 -0600 | [diff] [blame] | 84 | if [ $HASERROR -eq 0 ] |
| 85 | then |
Dan Sinclair | 3f072e1 | 2019-10-15 16:47:28 -0400 | [diff] [blame] | 86 | rm $TARGETDIR/singleThread.out |
| 87 | rm $TARGETDIR/multiThread.out |
John Kessenich | 4b1a890 | 2017-07-06 11:58:12 -0600 | [diff] [blame] | 88 | fi |
John Kessenich | b38c969 | 2015-05-15 19:01:17 +0000 | [diff] [blame] | 89 | |
steve-lunarg | f1e0c87 | 2016-10-31 15:13:43 -0600 | [diff] [blame] | 90 | # |
| 91 | # entry point renaming tests |
| 92 | # |
John Kessenich | 906cc21 | 2016-12-09 19:22:20 -0700 | [diff] [blame] | 93 | echo Running entry-point renaming tests |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 94 | 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 |
steve-lunarg | f1e0c87 | 2016-10-31 15:13:43 -0600 | [diff] [blame] | 95 | diff -b $BASEDIR/hlsl.entry.rename.frag.out $TARGETDIR/hlsl.entry.rename.frag.out || HASERROR=1 |
| 96 | |
John Kessenich | 906cc21 | 2016-12-09 19:22:20 -0700 | [diff] [blame] | 97 | # |
| 98 | # Testing ill-defined uncalled function |
| 99 | # |
| 100 | echo Running ill-defined uncalled function |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 101 | run -D -Od -e main -H -Od hlsl.deadFunctionMissingBody.vert > $TARGETDIR/hlsl.deadFunctionMissingBody.vert.out |
John Kessenich | 906cc21 | 2016-12-09 19:22:20 -0700 | [diff] [blame] | 102 | diff -b $BASEDIR/hlsl.deadFunctionMissingBody.vert.out $TARGETDIR/hlsl.deadFunctionMissingBody.vert.out || HASERROR=1 |
| 103 | |
John Kessenich | 84ea15f | 2015-05-15 21:54:24 +0000 | [diff] [blame] | 104 | if [ $HASERROR -eq 0 ] |
| 105 | then |
| 106 | echo Tests Succeeded. |
| 107 | else |
| 108 | echo Tests Failed. |
| 109 | fi |
| 110 | |
John Kessenich | e751bca | 2017-03-16 11:20:38 -0600 | [diff] [blame] | 111 | # |
John Kessenich | 2ead40f | 2018-04-17 17:44:11 -0600 | [diff] [blame] | 112 | # Testing -S and compound suffixes |
John Kessenich | e751bca | 2017-03-16 11:20:38 -0600 | [diff] [blame] | 113 | # |
John Kessenich | 2ead40f | 2018-04-17 17:44:11 -0600 | [diff] [blame] | 114 | echo Running explicit stage test and compound suffix tests |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 115 | run -Od -i -S vert nosuffix > $TARGETDIR/nosuffix.out |
John Kessenich | e751bca | 2017-03-16 11:20:38 -0600 | [diff] [blame] | 116 | diff -b $BASEDIR/nosuffix.out $TARGETDIR/nosuffix.out || HASERROR=1 |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 117 | run -Od -i compoundsuffix.vert.glsl > $TARGETDIR/compoundsuffix.vert.glsl |
John Kessenich | 2ead40f | 2018-04-17 17:44:11 -0600 | [diff] [blame] | 118 | diff -b $BASEDIR/compoundsuffix.vert.glsl $TARGETDIR/compoundsuffix.vert.glsl || HASERROR=1 |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 119 | run -Od -e main -H compoundsuffix.frag.hlsl > $TARGETDIR/compoundsuffix.frag.hlsl |
John Kessenich | 2ead40f | 2018-04-17 17:44:11 -0600 | [diff] [blame] | 120 | diff -b $BASEDIR/compoundsuffix.frag.hlsl $TARGETDIR/compoundsuffix.frag.hlsl || HASERROR=1 |
John Kessenich | e751bca | 2017-03-16 11:20:38 -0600 | [diff] [blame] | 121 | |
John Kessenich | 4f1403e | 2017-04-05 17:38:20 -0600 | [diff] [blame] | 122 | # |
| 123 | # Testing --hlsl-offsets |
| 124 | # |
| 125 | echo Running hlsl offsets |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 126 | run -i --hlsl-offsets -H spv.hlslOffsets.vert > $TARGETDIR/spv.hlslOffsets.vert.out |
John Kessenich | 4f1403e | 2017-04-05 17:38:20 -0600 | [diff] [blame] | 127 | diff -b $BASEDIR/spv.hlslOffsets.vert.out $TARGETDIR/spv.hlslOffsets.vert.out || HASERROR=1 |
| 128 | |
| 129 | echo Running hlsl offsets |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 130 | run -i --hlsl-offsets -D -Od -e main -H -Od hlsl.hlslOffset.vert > $TARGETDIR/hlsl.hlslOffset.vert.out |
John Kessenich | 4f1403e | 2017-04-05 17:38:20 -0600 | [diff] [blame] | 131 | diff -b $BASEDIR/hlsl.hlslOffset.vert.out $TARGETDIR/hlsl.hlslOffset.vert.out || HASERROR=1 |
| 132 | |
| 133 | # |
John Kessenich | 71facdf | 2017-05-17 18:28:19 -0600 | [diff] [blame] | 134 | # Testing --resource-set-binding |
Hyangran Park | 36dc829 | 2017-05-02 16:27:29 +0900 | [diff] [blame] | 135 | # |
| 136 | echo Configuring HLSL descriptor set and binding number manually |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 137 | 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 |
John Kessenich | 121853f | 2017-05-31 17:11:16 -0600 | [diff] [blame] | 138 | diff -b $BASEDIR/hlsl.multiDescriptorSet.frag.out $TARGETDIR/hlsl.multiDescriptorSet.frag.out || HASERROR=1 |
Hyangran Park | 36dc829 | 2017-05-02 16:27:29 +0900 | [diff] [blame] | 139 | |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 140 | 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 |
LoopDawg | 5201719 | 2017-07-14 15:15:47 -0600 | [diff] [blame] | 141 | diff -b $BASEDIR/hlsl.explicitDescriptorSet.frag.out $TARGETDIR/hlsl.explicitDescriptorSet.frag.out || HASERROR=1 |
| 142 | |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 143 | 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 |
LoopDawg | 5201719 | 2017-07-14 15:15:47 -0600 | [diff] [blame] | 144 | diff -b $BASEDIR/hlsl.explicitDescriptorSet-2.frag.out $TARGETDIR/hlsl.explicitDescriptorSet-2.frag.out || HASERROR=1 |
| 145 | |
Hyangran Park | 36dc829 | 2017-05-02 16:27:29 +0900 | [diff] [blame] | 146 | # |
LoopDawg | 08a1442 | 2017-10-17 19:27:14 -0600 | [diff] [blame] | 147 | # Testing per-descriptor-set IO map shift |
| 148 | # |
| 149 | echo 'Testing per-descriptor-set IO map shift' |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 150 | 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 |
LoopDawg | 08a1442 | 2017-10-17 19:27:14 -0600 | [diff] [blame] | 151 | diff -b $BASEDIR/hlsl.shift.per-set.frag.out $TARGETDIR/hlsl.shift.per-set.frag.out || HASERROR=1 |
| 152 | |
| 153 | # |
John Kessenich | 71facdf | 2017-05-17 18:28:19 -0600 | [diff] [blame] | 154 | # Testing location error |
| 155 | # |
| 156 | echo Testing SPV no location |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 157 | run -V -C spv.noLocation.vert > $TARGETDIR/spv.noLocation.vert.out |
John Kessenich | 121853f | 2017-05-31 17:11:16 -0600 | [diff] [blame] | 158 | diff -b $BASEDIR/spv.noLocation.vert.out $TARGETDIR/spv.noLocation.vert.out || HASERROR=1 |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 159 | run -G -H --aml spv.noBuiltInLoc.vert > $TARGETDIR/spv.noBuiltInLoc.vert.out |
John Kessenich | 91e69c0 | 2017-07-14 05:52:31 -0600 | [diff] [blame] | 160 | diff -b $BASEDIR/spv.noBuiltInLoc.vert.out $TARGETDIR/spv.noBuiltInLoc.vert.out || HASERROR=1 |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 161 | run -G spv.looseUniformNoLoc.vert > $TARGETDIR/spv.looseUniformNoLoc.vert.out |
John Kessenich | 82e95a3 | 2017-08-26 15:47:25 -0600 | [diff] [blame] | 162 | diff -b $BASEDIR/spv.looseUniformNoLoc.vert.out $TARGETDIR/spv.looseUniformNoLoc.vert.out || HASERROR=1 |
John Kessenich | 121853f | 2017-05-31 17:11:16 -0600 | [diff] [blame] | 163 | |
| 164 | # |
| 165 | # Testing debug information |
| 166 | # |
| 167 | echo Testing SPV Debug Information |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 168 | run -g --relaxed-errors --suppress-warnings --aml --amb --hlsl-offsets --nsf --spirv-val \ |
John Kessenich | 2a27116 | 2017-07-20 20:00:36 -0600 | [diff] [blame] | 169 | -G -H spv.debugInfo.frag --rsb frag 3 > $TARGETDIR/spv.debugInfo.frag.out |
John Kessenich | 121853f | 2017-05-31 17:11:16 -0600 | [diff] [blame] | 170 | diff -b $BASEDIR/spv.debugInfo.frag.out $TARGETDIR/spv.debugInfo.frag.out || HASERROR=1 |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 171 | run -g -Od --target-env vulkan1.1 --relaxed-errors --suppress-warnings --aml --amb --hlsl-offsets --nsf --spirv-val \ |
Greg Fischer | e453088 | 2021-01-05 11:21:20 -0700 | [diff] [blame] | 172 | -V -H spv.debugInfo.frag --rsb frag 3 > $TARGETDIR/spv.debugInfo.1.1.frag.out |
John Kessenich | 66011cb | 2018-03-06 16:12:04 -0700 | [diff] [blame] | 173 | diff -b $BASEDIR/spv.debugInfo.1.1.frag.out $TARGETDIR/spv.debugInfo.1.1.frag.out || HASERROR=1 |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 174 | 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 \ |
GregF | cd1f169 | 2017-09-21 18:40:22 -0600 | [diff] [blame] | 175 | --sep origMain -H -Od spv.hlslDebugInfo.vert --rsb vert t0 0 0 > $TARGETDIR/spv.hlslDebugInfo.frag.out |
John Kessenich | 2a27116 | 2017-07-20 20:00:36 -0600 | [diff] [blame] | 176 | diff -b $BASEDIR/spv.hlslDebugInfo.frag.out $TARGETDIR/spv.hlslDebugInfo.frag.out || HASERROR=1 |
John Kessenich | 71facdf | 2017-05-17 18:28:19 -0600 | [diff] [blame] | 177 | |
| 178 | # |
John Kessenich | 3494b4d | 2017-05-22 15:00:42 -0600 | [diff] [blame] | 179 | # Testing Includer |
| 180 | # |
| 181 | echo Testing Includer |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 182 | run -D -Od -e main -H -Od ../Test/hlsl.include.vert > $TARGETDIR/hlsl.include.vert.out |
John Kessenich | 3494b4d | 2017-05-22 15:00:42 -0600 | [diff] [blame] | 183 | diff -b $BASEDIR/hlsl.include.vert.out $TARGETDIR/hlsl.include.vert.out || HASERROR=1 |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 184 | run -D -Od -e main -H -Od hlsl.includeNegative.vert > $TARGETDIR/hlsl.includeNegative.vert.out |
John Kessenich | 3494b4d | 2017-05-22 15:00:42 -0600 | [diff] [blame] | 185 | diff -b $BASEDIR/hlsl.includeNegative.vert.out $TARGETDIR/hlsl.includeNegative.vert.out || HASERROR=1 |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 186 | run -l -i include.vert > $TARGETDIR/include.vert.out |
John Kessenich | 3494b4d | 2017-05-22 15:00:42 -0600 | [diff] [blame] | 187 | diff -b $BASEDIR/include.vert.out $TARGETDIR/include.vert.out || HASERROR=1 |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 188 | run -D -Od -e main -H -Od -Iinc1/path1 -Iinc1/path2 hlsl.dashI.vert > $TARGETDIR/hlsl.dashI.vert.out |
John Kessenich | 971a0a8 | 2017-06-07 15:06:58 -0600 | [diff] [blame] | 189 | diff -b $BASEDIR/hlsl.dashI.vert.out $TARGETDIR/hlsl.dashI.vert.out || HASERROR=1 |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 190 | run -D -Od -e MainPs -H -Od -g hlsl.pp.line3.frag > $TARGETDIR/hlsl.pp.line3.frag.out |
greg-lunarg | 5d43c4a | 2018-12-07 17:36:33 -0700 | [diff] [blame] | 191 | diff -b $BASEDIR/hlsl.pp.line3.frag.out $TARGETDIR/hlsl.pp.line3.frag.out || HASERROR=1 |
John Kessenich | 3494b4d | 2017-05-22 15:00:42 -0600 | [diff] [blame] | 192 | |
| 193 | # |
Georg Lehmann | 498d74d | 2021-04-20 18:12:39 +0200 | [diff] [blame] | 194 | # Testing --depfile |
| 195 | # |
| 196 | |
| 197 | echo "Testing --depfile" |
| 198 | run -D -Od -e main -H --depfile $TARGETDIR/hlsl.include.vert.d.out -Od ../Test/hlsl.include.vert > $TARGETDIR/hlsl.include.vert.out |
| 199 | diff -b $BASEDIR/hlsl.include.vert.d.out $TARGETDIR/hlsl.include.vert.d.out || HASERROR=1 |
| 200 | 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 |
| 201 | diff -b $BASEDIR/hlsl.dashI.vert.d.out $TARGETDIR/hlsl.dashI.vert.d.out || HASERROR=1 |
| 202 | |
| 203 | # |
John Kessenich | a931366 | 2017-06-15 10:40:49 -0600 | [diff] [blame] | 204 | # Testing -D and -U |
| 205 | # |
LoopDawg | 8004d36 | 2017-09-17 10:38:52 -0600 | [diff] [blame] | 206 | echo "Testing -D and -U" |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 207 | 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 |
John Kessenich | a931366 | 2017-06-15 10:40:49 -0600 | [diff] [blame] | 208 | diff -b $BASEDIR/glsl.-D-U.frag.out $TARGETDIR/glsl.-D-U.frag.out || HASERROR=1 |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 209 | 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 |
John Kessenich | a931366 | 2017-06-15 10:40:49 -0600 | [diff] [blame] | 210 | diff -b $BASEDIR/hlsl.-D-U.frag.out $TARGETDIR/hlsl.-D-U.frag.out || HASERROR=1 |
| 211 | |
| 212 | # |
John Kessenich | 6353d55 | 2017-06-23 11:11:09 -0600 | [diff] [blame] | 213 | # Test --client and --target-env |
| 214 | # |
LoopDawg | 8004d36 | 2017-09-17 10:38:52 -0600 | [diff] [blame] | 215 | echo "Testing --client and --target-env" |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 216 | run --client vulkan100 spv.targetVulkan.vert || HASERROR=1 |
| 217 | run --client opengl100 spv.targetOpenGL.vert || HASERROR=1 |
| 218 | run --target-env vulkan1.0 spv.targetVulkan.vert || HASERROR=1 |
| 219 | run --target-env vulkan1.1 spv.targetVulkan.vert || HASERROR=1 |
| 220 | run --target-env vulkan1.2 spv.targetVulkan.vert || HASERROR=1 |
| 221 | run --target-env opengl spv.targetOpenGL.vert || HASERROR=1 |
| 222 | run -V100 spv.targetVulkan.vert || HASERROR=1 |
| 223 | run -G100 spv.targetOpenGL.vert || HASERROR=1 |
| 224 | run --target-env spirv1.2 -V spv.targetVulkan.vert || HASERROR=1 |
John Kessenich | 6353d55 | 2017-06-23 11:11:09 -0600 | [diff] [blame] | 225 | |
| 226 | # |
John Kessenich | 9855bda | 2017-09-11 21:48:19 -0600 | [diff] [blame] | 227 | # Testing GLSL entry point rename |
| 228 | # |
LoopDawg | 8004d36 | 2017-09-17 10:38:52 -0600 | [diff] [blame] | 229 | echo "Testing GLSL entry point rename" |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 230 | run -H -e foo --source-entrypoint main glsl.entryPointRename.vert > $TARGETDIR/glsl.entryPointRename.vert.out |
John Kessenich | 9855bda | 2017-09-11 21:48:19 -0600 | [diff] [blame] | 231 | diff -b $BASEDIR/glsl.entryPointRename.vert.out $TARGETDIR/glsl.entryPointRename.vert.out || HASERROR=1 |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 232 | run -H -e foo --source-entrypoint bar glsl.entryPointRename.vert > $TARGETDIR/glsl.entryPointRename.vert.bad.out |
John Kessenich | 9855bda | 2017-09-11 21:48:19 -0600 | [diff] [blame] | 233 | diff -b $BASEDIR/glsl.entryPointRename.vert.bad.out $TARGETDIR/glsl.entryPointRename.vert.bad.out || HASERROR=1 |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 234 | run -H -e foo --source-entrypoint main glsl.entryPointRename2.vert > $TARGETDIR/glsl.entryPointRename2.vert.out |
John Kessenich | 9855bda | 2017-09-11 21:48:19 -0600 | [diff] [blame] | 235 | diff -b $BASEDIR/glsl.entryPointRename2.vert.out $TARGETDIR/glsl.entryPointRename2.vert.out || HASERROR=1 |
| 236 | |
| 237 | # |
LoopDawg | 8004d36 | 2017-09-17 10:38:52 -0600 | [diff] [blame] | 238 | # Testing remapper error handling |
| 239 | # |
| 240 | echo "Testing remapper error handling" |
| 241 | $REMAPEXE --do-everything -i remap.invalid-spirv-1.spv -o $TARGETDIR > $TARGETDIR/remap.invalid-spirv-1.out && HASERROR=1 |
| 242 | diff -b $BASEDIR/remap.invalid-spirv-1.out $TARGETDIR/remap.invalid-spirv-1.out || HASERROR=1 |
| 243 | $REMAPEXE --do-everything -i remap.invalid-spirv-2.spv -o $TARGETDIR > $TARGETDIR/remap.invalid-spirv-2.out && HASERROR=1 |
| 244 | diff -b $BASEDIR/remap.invalid-spirv-2.out $TARGETDIR/remap.invalid-spirv-2.out || HASERROR=1 |
| 245 | |
| 246 | # |
LoopDawg | b22c069 | 2017-12-06 16:52:03 -0700 | [diff] [blame] | 247 | # Testing position Y inversion |
| 248 | # |
| 249 | echo "Testing position Y inversion" |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 250 | run -H -e main -V -D -Od -H -i --iy hlsl.y-negate-1.vert > $TARGETDIR/hlsl.y-negate-1.vert.out |
LoopDawg | b22c069 | 2017-12-06 16:52:03 -0700 | [diff] [blame] | 251 | diff -b $BASEDIR/hlsl.y-negate-1.vert.out $TARGETDIR/hlsl.y-negate-1.vert.out || HASERROR=1 |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 252 | run -H -e main -V -D -Od -H -i --invert-y hlsl.y-negate-2.vert > $TARGETDIR/hlsl.y-negate-2.vert.out |
LoopDawg | b22c069 | 2017-12-06 16:52:03 -0700 | [diff] [blame] | 253 | diff -b $BASEDIR/hlsl.y-negate-2.vert.out $TARGETDIR/hlsl.y-negate-2.vert.out || HASERROR=1 |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 254 | run -H -e main -V -D -Od -H -i --invert-y hlsl.y-negate-3.vert > $TARGETDIR/hlsl.y-negate-3.vert.out |
LoopDawg | b22c069 | 2017-12-06 16:52:03 -0700 | [diff] [blame] | 255 | diff -b $BASEDIR/hlsl.y-negate-3.vert.out $TARGETDIR/hlsl.y-negate-3.vert.out || HASERROR=1 |
| 256 | |
| 257 | # |
Greg Fischer | e9564fe | 2021-11-16 18:42:12 -0700 | [diff] [blame] | 258 | # Testing position W reciprocal |
| 259 | # |
| 260 | echo "Testing position W reciprocal" |
| 261 | run -H -e main -V -D -Od -H -i --hlsl-dx-position-w hlsl.w-recip.frag > $TARGETDIR/hlsl.w-recip.frag.out |
| 262 | diff -b $BASEDIR/hlsl.w-recip.frag.out $TARGETDIR/hlsl.w-recip.frag.out || HASERROR=1 |
Greg Fischer | fbb39aa | 2021-12-07 14:33:09 -0700 | [diff] [blame] | 263 | run -H -e main -V -D -Od -H -i --hlsl-dx-position-w hlsl.w-recip2.frag > $TARGETDIR/hlsl.w-recip2.frag.out |
| 264 | diff -b $BASEDIR/hlsl.w-recip2.frag.out $TARGETDIR/hlsl.w-recip2.frag.out || HASERROR=1 |
Greg Fischer | e9564fe | 2021-11-16 18:42:12 -0700 | [diff] [blame] | 265 | |
| 266 | # |
John Kessenich | 5d610ee | 2018-03-07 18:05:55 -0700 | [diff] [blame] | 267 | # Testing hlsl_functionality1 |
| 268 | # |
John Kessenich | 086febc | 2018-10-25 12:43:02 -0600 | [diff] [blame] | 269 | echo "Testing hlsl_functionality1" |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 270 | run -H -e main -D -Od -fhlsl_functionality1 hlsl.structbuffer.incdec.frag > \ |
John Kessenich | 5d610ee | 2018-03-07 18:05:55 -0700 | [diff] [blame] | 271 | $TARGETDIR/hlsl.structbuffer.incdec.frag.hlslfun1.out |
| 272 | diff -b $BASEDIR/hlsl.structbuffer.incdec.frag.hlslfun1.out $TARGETDIR/hlsl.structbuffer.incdec.frag.hlslfun1.out || HASERROR=1 |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 273 | run -H -e main -D -Od -fhlsl_functionality1 hlsl.noSemantic.functionality1.comp > \ |
John Kessenich | f52b638 | 2018-04-05 19:35:38 -0600 | [diff] [blame] | 274 | $TARGETDIR/hlsl.noSemantic.functionality1.comp.out |
| 275 | diff -b $BASEDIR/hlsl.noSemantic.functionality1.comp.out $TARGETDIR/hlsl.noSemantic.functionality1.comp.out || HASERROR=1 |
John Kessenich | 5d610ee | 2018-03-07 18:05:55 -0700 | [diff] [blame] | 276 | |
| 277 | # |
John Kessenich | 9cc81de | 2018-07-02 10:40:32 -0600 | [diff] [blame] | 278 | # Testing HLSL-specific PP feature expansion |
| 279 | # |
John Kessenich | 086febc | 2018-10-25 12:43:02 -0600 | [diff] [blame] | 280 | echo "Testing HLSL-specific PP feature expansion" |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 281 | run -D -E hlsl.pp.expand.frag > $TARGETDIR/hlsl.pp.expand.frag.out 2> $TARGETDIR/hlsl.pp.expand.frag.err |
John Kessenich | 9cc81de | 2018-07-02 10:40:32 -0600 | [diff] [blame] | 282 | diff -b $BASEDIR/hlsl.pp.expand.frag.out $TARGETDIR/hlsl.pp.expand.frag.out || HASERROR=1 |
| 283 | diff -b $BASEDIR/hlsl.pp.expand.frag.err $TARGETDIR/hlsl.pp.expand.frag.err || HASERROR=1 |
| 284 | |
| 285 | # |
John Kessenich | 605afc7 | 2019-06-17 23:33:09 -0600 | [diff] [blame] | 286 | # Test --nan-clamp |
| 287 | # |
| 288 | echo "Testing nan-clamp" |
Ben Clayton | f429b72 | 2020-07-14 12:56:26 +0100 | [diff] [blame] | 289 | run --nan-clamp -H --aml --amb spv.400.frag > $TARGETDIR/spv.400.frag.nanclamp.out |
John Kessenich | 605afc7 | 2019-06-17 23:33:09 -0600 | [diff] [blame] | 290 | diff -b $BASEDIR/spv.400.frag.nanclamp.out $TARGETDIR/spv.400.frag.nanclamp.out || HASERROR=1 |
| 291 | |
| 292 | # |
Robin Quint | e50b0a8 | 2021-04-22 13:13:38 +0200 | [diff] [blame] | 293 | # Test --auto-sampled-textures |
| 294 | # |
| 295 | echo "Testing auto-sampled-textures" |
| 296 | run --auto-sampled-textures -H -Od -e MainPs -D -S frag hlsl.autosampledtextures.frag > $TARGETDIR/hlsl.autosampledtextures.frag.out |
| 297 | diff -b $BASEDIR/hlsl.autosampledtextures.frag.out $TARGETDIR/hlsl.autosampledtextures.frag.out || HASERROR=1 |
| 298 | run --auto-sampled-textures -H -Od -S frag glsl.autosampledtextures.frag > $TARGETDIR/glsl.autosampledtextures.frag.out |
| 299 | diff -b $BASEDIR/glsl.autosampledtextures.frag.out $TARGETDIR/glsl.autosampledtextures.frag.out || HASERROR=1 |
| 300 | |
Hai Nguyen | 6a3aeb7 | 2022-01-10 09:43:44 -0500 | [diff] [blame] | 301 | # Test --glsl-version |
| 302 | # |
| 303 | echo "Testing --glsl-version" |
| 304 | run --glsl-version 410 -V -S vert glsl.versionOverride.vert > $TARGETDIR/glsl.versionOverride.vert.out |
| 305 | diff -b $BASEDIR/glsl.versionOverride.vert.out $TARGETDIR/glsl.versionOverride.vert.out || HASERROR=1 |
| 306 | run --glsl-version 420 -V -S frag glsl.versionOverride.frag > $TARGETDIR/glsl.versionOverride.frag.out |
| 307 | diff -b $BASEDIR/glsl.versionOverride.frag.out $TARGETDIR/glsl.versionOverride.frag.out || HASERROR=1 |
| 308 | run --glsl-version 430 -V -S geom glsl.versionOverride.geom > $TARGETDIR/glsl.versionOverride.geom.out |
| 309 | diff -b $BASEDIR/glsl.versionOverride.geom.out $TARGETDIR/glsl.versionOverride.geom.out || HASERROR=1 |
| 310 | run --glsl-version 440 -V -S tesc glsl.versionOverride.tesc > $TARGETDIR/glsl.versionOverride.tesc.out |
| 311 | diff -b $BASEDIR/glsl.versionOverride.tesc.out $TARGETDIR/glsl.versionOverride.tesc.out || HASERROR=1 |
| 312 | run --glsl-version 450 -V -S tese glsl.versionOverride.tese > $TARGETDIR/glsl.versionOverride.tese.out |
| 313 | diff -b $BASEDIR/glsl.versionOverride.tese.out $TARGETDIR/glsl.versionOverride.tese.out || HASERROR=1 |
| 314 | run --glsl-version 460 -V -S comp glsl.versionOverride.comp > $TARGETDIR/glsl.versionOverride.comp.out |
| 315 | diff -b $BASEDIR/glsl.versionOverride.comp.out $TARGETDIR/glsl.versionOverride.comp.out || HASERROR=1 |
| 316 | |
Robin Quint | e50b0a8 | 2021-04-22 13:13:38 +0200 | [diff] [blame] | 317 | # |
Greg Fischer | ca0d54d | 2021-12-30 11:56:57 -0700 | [diff] [blame] | 318 | # Test --enhanced-msgs |
| 319 | # |
| 320 | |
| 321 | echo "Testing enhanced-msgs" |
| 322 | run --enhanced-msgs -V --target-env vulkan1.2 --amb --aml enhanced.0.frag > $TARGETDIR/enhanced.0.frag.out |
| 323 | diff -b $BASEDIR/enhanced.0.frag.out $TARGETDIR/enhanced.0.frag.out || HASERROR=1 |
| 324 | run --enhanced-msgs -V --target-env vulkan1.2 --amb --aml enhanced.1.frag > $TARGETDIR/enhanced.1.frag.out |
| 325 | diff -b $BASEDIR/enhanced.1.frag.out $TARGETDIR/enhanced.1.frag.out || HASERROR=1 |
| 326 | run --enhanced-msgs -V --target-env vulkan1.2 --amb --aml enhanced.2.frag > $TARGETDIR/enhanced.2.frag.out |
| 327 | diff -b $BASEDIR/enhanced.2.frag.out $TARGETDIR/enhanced.2.frag.out || HASERROR=1 |
| 328 | run --enhanced-msgs -V --target-env vulkan1.2 --amb --aml enhanced.3.vert enhanced.3.frag > $TARGETDIR/enhanced.3.link.out |
| 329 | diff -b $BASEDIR/enhanced.3.link.out $TARGETDIR/enhanced.3.link.out || HASERROR=1 |
| 330 | run --enhanced-msgs -V --target-env vulkan1.2 --amb --aml enhanced.4.vert enhanced.4.frag > $TARGETDIR/enhanced.4.link.out |
| 331 | diff -b $BASEDIR/enhanced.4.link.out $TARGETDIR/enhanced.4.link.out || HASERROR=1 |
| 332 | run --enhanced-msgs -V --target-env vulkan1.2 --amb --aml enhanced.5.vert enhanced.5.frag > $TARGETDIR/enhanced.5.link.out |
| 333 | diff -b $BASEDIR/enhanced.5.link.out $TARGETDIR/enhanced.5.link.out || HASERROR=1 |
| 334 | run --enhanced-msgs -V --target-env vulkan1.2 --amb --aml enhanced.6.vert enhanced.6.frag > $TARGETDIR/enhanced.6.link.out |
| 335 | diff -b $BASEDIR/enhanced.6.link.out $TARGETDIR/enhanced.6.link.out || HASERROR=1 |
| 336 | run --enhanced-msgs -V --target-env vulkan1.2 --amb --aml enhanced.7.vert enhanced.7.frag > $TARGETDIR/enhanced.7.link.out |
| 337 | diff -b $BASEDIR/enhanced.7.link.out $TARGETDIR/enhanced.7.link.out || HASERROR=1 |
Greg Fischer | bbe692e | 2022-02-18 15:08:28 -0700 | [diff] [blame] | 338 | run --enhanced-msgs -V --target-env vulkan1.2 --amb --aml spv.textureError.frag > $TARGETDIR/spv.textureError.frag.out |
| 339 | diff -b $BASEDIR/spv.textureError.frag.out $TARGETDIR/spv.textureError.frag.out || HASERROR=1 |
Greg Fischer | ca0d54d | 2021-12-30 11:56:57 -0700 | [diff] [blame] | 340 | |
| 341 | # |
John Kessenich | 4f1403e | 2017-04-05 17:38:20 -0600 | [diff] [blame] | 342 | # Final checking |
| 343 | # |
John Kessenich | e751bca | 2017-03-16 11:20:38 -0600 | [diff] [blame] | 344 | if [ $HASERROR -eq 0 ] |
| 345 | then |
| 346 | echo Tests Succeeded. |
| 347 | else |
| 348 | echo Tests Failed. |
| 349 | fi |
| 350 | |
John Kessenich | 4b1a890 | 2017-07-06 11:58:12 -0600 | [diff] [blame] | 351 | rm -f comp.spv frag.spv geom.spv tesc.spv tese.spv vert.spv |
| 352 | |
John Kessenich | b38c969 | 2015-05-15 19:01:17 +0000 | [diff] [blame] | 353 | exit $HASERROR |