John Kessenich | aab2514 | 2013-02-12 18:26:15 +0000 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
John Kessenich | 4586dbd | 2013-08-05 15:52:03 +0000 | [diff] [blame] | 3 | TARGETDIR=localResults |
| 4 | BASEDIR=baseResults |
John Kessenich | d18e2d8 | 2014-03-11 02:10:26 +0000 | [diff] [blame] | 5 | EXE=../build/install/bin/glslangValidator |
LoopDawg | 8004d36 | 2017-09-17 10:38:52 -0600 | [diff] [blame] | 6 | REMAPEXE=../build/install/bin/spirv-remap |
John Kessenich | b38c969 | 2015-05-15 19:01:17 +0000 | [diff] [blame] | 7 | HASERROR=0 |
John Kessenich | 08d1824 | 2013-12-20 18:36:27 +0000 | [diff] [blame] | 8 | mkdir -p localResults |
John Kessenich | 69f4b51 | 2013-09-04 21:19:27 +0000 | [diff] [blame] | 9 | |
John Kessenich | cf0206c | 2014-04-14 15:46:40 +0000 | [diff] [blame] | 10 | if [ -a localtestlist ] |
| 11 | then |
| 12 | while read t; do |
| 13 | echo Running $t... |
| 14 | b=`basename $t` |
| 15 | $EXE -i -l $t > $TARGETDIR/$b.out |
John Kessenich | b38c969 | 2015-05-15 19:01:17 +0000 | [diff] [blame] | 16 | diff -b $BASEDIR/$b.out $TARGETDIR/$b.out || HASERROR=1 |
John Kessenich | cf0206c | 2014-04-14 15:46:40 +0000 | [diff] [blame] | 17 | done < localtestlist |
| 18 | fi |
| 19 | |
johnkslang | 02ad18a | 2015-06-26 00:12:31 -0600 | [diff] [blame] | 20 | 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] | 21 | |
| 22 | # |
John Kessenich | 31a51be | 2016-07-19 14:32:52 -0600 | [diff] [blame] | 23 | # special tests |
| 24 | # |
| 25 | |
| 26 | $EXE badMacroArgs.frag > $TARGETDIR/badMacroArgs.frag.out |
| 27 | diff -b $BASEDIR/badMacroArgs.frag.out $TARGETDIR/badMacroArgs.frag.out || HASERROR=1 |
| 28 | |
| 29 | # |
John Kessenich | 11f9fc7 | 2013-11-07 01:06:34 +0000 | [diff] [blame] | 30 | # reflection tests |
| 31 | # |
| 32 | echo Running reflection... |
John Kessenich | a86836e | 2016-07-09 14:50:57 -0600 | [diff] [blame] | 33 | $EXE -l -q -C reflection.vert > $TARGETDIR/reflection.vert.out |
John Kessenich | b38c969 | 2015-05-15 19:01:17 +0000 | [diff] [blame] | 34 | diff -b $BASEDIR/reflection.vert.out $TARGETDIR/reflection.vert.out || HASERROR=1 |
baldurk | 1905069 | 2019-02-11 11:50:24 +0000 | [diff] [blame] | 35 | $EXE -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 reflection.options.vert > $TARGETDIR/reflection.options.vert.out |
baldurk | 15c37f7 | 2019-01-29 12:12:59 +0000 | [diff] [blame] | 36 | diff -b $BASEDIR/reflection.options.vert.out $TARGETDIR/reflection.options.vert.out || HASERROR=1 |
baldurk | 0af5e3e | 2019-01-29 16:04:44 +0000 | [diff] [blame] | 37 | $EXE -l -q -C reflection.frag > $TARGETDIR/reflection.frag.out |
| 38 | diff -b $BASEDIR/reflection.frag.out $TARGETDIR/reflection.frag.out || HASERROR=1 |
baldurk | 1905069 | 2019-02-11 11:50:24 +0000 | [diff] [blame] | 39 | $EXE -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 reflection.frag > $TARGETDIR/reflection.options.frag.out |
baldurk | 0af5e3e | 2019-01-29 16:04:44 +0000 | [diff] [blame] | 40 | diff -b $BASEDIR/reflection.options.frag.out $TARGETDIR/reflection.options.frag.out || HASERROR=1 |
baldurk | 1905069 | 2019-02-11 11:50:24 +0000 | [diff] [blame] | 41 | $EXE -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 reflection.options.geom > $TARGETDIR/reflection.options.geom.out |
| 42 | diff -b $BASEDIR/reflection.options.geom.out $TARGETDIR/reflection.options.geom.out || HASERROR=1 |
baldurk | a972e73 | 2019-01-30 15:34:02 +0000 | [diff] [blame] | 43 | $EXE -l -q -C reflection.linked.vert reflection.linked.frag > $TARGETDIR/reflection.linked.out |
| 44 | diff -b $BASEDIR/reflection.linked.out $TARGETDIR/reflection.linked.out || HASERROR=1 |
baldurk | 1905069 | 2019-02-11 11:50:24 +0000 | [diff] [blame] | 45 | $EXE -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 reflection.linked.vert reflection.linked.frag > $TARGETDIR/reflection.linked.options.out |
baldurk | a972e73 | 2019-01-30 15:34:02 +0000 | [diff] [blame] | 46 | diff -b $BASEDIR/reflection.linked.options.out $TARGETDIR/reflection.linked.options.out || HASERROR=1 |
John Kessenich | b3cff2f | 2017-12-21 12:17:25 -0700 | [diff] [blame] | 47 | $EXE -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] | 48 | diff -b $BASEDIR/hlsl.reflection.vert.out $TARGETDIR/hlsl.reflection.vert.out || HASERROR=1 |
John Kessenich | b3cff2f | 2017-12-21 12:17:25 -0700 | [diff] [blame] | 49 | $EXE -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] | 50 | diff -b $BASEDIR/hlsl.reflection.binding.frag.out $TARGETDIR/hlsl.reflection.binding.frag.out || HASERROR=1 |
John Kessenich | b3cff2f | 2017-12-21 12:17:25 -0700 | [diff] [blame] | 51 | $EXE -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] | 52 | 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] | 53 | |
| 54 | # |
John Kessenich | 38f3b89 | 2013-09-06 19:52:57 +0000 | [diff] [blame] | 55 | # multi-threaded test |
| 56 | # |
John Kessenich | 38f3b89 | 2013-09-06 19:52:57 +0000 | [diff] [blame] | 57 | echo Comparing single thread to multithread for all tests in current directory... |
John Kessenich | 23d2775 | 2019-07-28 02:12:10 -0600 | [diff] [blame] | 58 | $EXE -i -C *.vert *.geom *.frag *.tesc *.tese *.comp > singleThread.out |
| 59 | $EXE -i -C *.vert *.geom *.frag *.tesc *.tese *.comp -t > multiThread.out |
John Kessenich | b38c969 | 2015-05-15 19:01:17 +0000 | [diff] [blame] | 60 | diff singleThread.out multiThread.out || HASERROR=1 |
John Kessenich | 4b1a890 | 2017-07-06 11:58:12 -0600 | [diff] [blame] | 61 | if [ $HASERROR -eq 0 ] |
| 62 | then |
| 63 | rm singleThread.out |
| 64 | rm multiThread.out |
| 65 | fi |
John Kessenich | b38c969 | 2015-05-15 19:01:17 +0000 | [diff] [blame] | 66 | |
steve-lunarg | f1e0c87 | 2016-10-31 15:13:43 -0600 | [diff] [blame] | 67 | # |
| 68 | # entry point renaming tests |
| 69 | # |
John Kessenich | 906cc21 | 2016-12-09 19:22:20 -0700 | [diff] [blame] | 70 | echo Running entry-point renaming tests |
John Kessenich | 640bd09 | 2018-08-09 14:15:00 -0600 | [diff] [blame] | 71 | $EXE -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] | 72 | diff -b $BASEDIR/hlsl.entry.rename.frag.out $TARGETDIR/hlsl.entry.rename.frag.out || HASERROR=1 |
| 73 | |
John Kessenich | 906cc21 | 2016-12-09 19:22:20 -0700 | [diff] [blame] | 74 | # |
| 75 | # Testing ill-defined uncalled function |
| 76 | # |
| 77 | echo Running ill-defined uncalled function |
John Kessenich | b3cff2f | 2017-12-21 12:17:25 -0700 | [diff] [blame] | 78 | $EXE -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] | 79 | diff -b $BASEDIR/hlsl.deadFunctionMissingBody.vert.out $TARGETDIR/hlsl.deadFunctionMissingBody.vert.out || HASERROR=1 |
| 80 | |
John Kessenich | 84ea15f | 2015-05-15 21:54:24 +0000 | [diff] [blame] | 81 | if [ $HASERROR -eq 0 ] |
| 82 | then |
| 83 | echo Tests Succeeded. |
| 84 | else |
| 85 | echo Tests Failed. |
| 86 | fi |
| 87 | |
John Kessenich | e751bca | 2017-03-16 11:20:38 -0600 | [diff] [blame] | 88 | # |
John Kessenich | 2ead40f | 2018-04-17 17:44:11 -0600 | [diff] [blame] | 89 | # Testing -S and compound suffixes |
John Kessenich | e751bca | 2017-03-16 11:20:38 -0600 | [diff] [blame] | 90 | # |
John Kessenich | 2ead40f | 2018-04-17 17:44:11 -0600 | [diff] [blame] | 91 | echo Running explicit stage test and compound suffix tests |
John Kessenich | ecbd056 | 2018-05-10 10:22:13 -0600 | [diff] [blame] | 92 | $EXE -Od -i -S vert nosuffix > $TARGETDIR/nosuffix.out |
John Kessenich | e751bca | 2017-03-16 11:20:38 -0600 | [diff] [blame] | 93 | diff -b $BASEDIR/nosuffix.out $TARGETDIR/nosuffix.out || HASERROR=1 |
John Kessenich | ecbd056 | 2018-05-10 10:22:13 -0600 | [diff] [blame] | 94 | $EXE -Od -i compoundsuffix.vert.glsl > $TARGETDIR/compoundsuffix.vert.glsl |
John Kessenich | 2ead40f | 2018-04-17 17:44:11 -0600 | [diff] [blame] | 95 | diff -b $BASEDIR/compoundsuffix.vert.glsl $TARGETDIR/compoundsuffix.vert.glsl || HASERROR=1 |
John Kessenich | ecbd056 | 2018-05-10 10:22:13 -0600 | [diff] [blame] | 96 | $EXE -Od -e main -H compoundsuffix.frag.hlsl > $TARGETDIR/compoundsuffix.frag.hlsl |
John Kessenich | 2ead40f | 2018-04-17 17:44:11 -0600 | [diff] [blame] | 97 | diff -b $BASEDIR/compoundsuffix.frag.hlsl $TARGETDIR/compoundsuffix.frag.hlsl || HASERROR=1 |
John Kessenich | e751bca | 2017-03-16 11:20:38 -0600 | [diff] [blame] | 98 | |
John Kessenich | 4f1403e | 2017-04-05 17:38:20 -0600 | [diff] [blame] | 99 | # |
| 100 | # Testing --hlsl-offsets |
| 101 | # |
| 102 | echo Running hlsl offsets |
| 103 | $EXE -i --hlsl-offsets -H spv.hlslOffsets.vert > $TARGETDIR/spv.hlslOffsets.vert.out |
| 104 | diff -b $BASEDIR/spv.hlslOffsets.vert.out $TARGETDIR/spv.hlslOffsets.vert.out || HASERROR=1 |
| 105 | |
| 106 | echo Running hlsl offsets |
John Kessenich | b3cff2f | 2017-12-21 12:17:25 -0700 | [diff] [blame] | 107 | $EXE -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] | 108 | diff -b $BASEDIR/hlsl.hlslOffset.vert.out $TARGETDIR/hlsl.hlslOffset.vert.out || HASERROR=1 |
| 109 | |
| 110 | # |
John Kessenich | 71facdf | 2017-05-17 18:28:19 -0600 | [diff] [blame] | 111 | # Testing --resource-set-binding |
Hyangran Park | 36dc829 | 2017-05-02 16:27:29 +0900 | [diff] [blame] | 112 | # |
| 113 | echo Configuring HLSL descriptor set and binding number manually |
John Kessenich | b3cff2f | 2017-12-21 12:17:25 -0700 | [diff] [blame] | 114 | $EXE -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] | 115 | 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] | 116 | |
John Kessenich | b3cff2f | 2017-12-21 12:17:25 -0700 | [diff] [blame] | 117 | $EXE -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] | 118 | diff -b $BASEDIR/hlsl.explicitDescriptorSet.frag.out $TARGETDIR/hlsl.explicitDescriptorSet.frag.out || HASERROR=1 |
| 119 | |
John Kessenich | b3cff2f | 2017-12-21 12:17:25 -0700 | [diff] [blame] | 120 | $EXE -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] | 121 | diff -b $BASEDIR/hlsl.explicitDescriptorSet-2.frag.out $TARGETDIR/hlsl.explicitDescriptorSet-2.frag.out || HASERROR=1 |
| 122 | |
Hyangran Park | 36dc829 | 2017-05-02 16:27:29 +0900 | [diff] [blame] | 123 | # |
LoopDawg | 08a1442 | 2017-10-17 19:27:14 -0600 | [diff] [blame] | 124 | # Testing per-descriptor-set IO map shift |
| 125 | # |
| 126 | echo 'Testing per-descriptor-set IO map shift' |
John Kessenich | 251901a | 2018-08-12 22:05:59 -0600 | [diff] [blame] | 127 | $EXE -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] | 128 | diff -b $BASEDIR/hlsl.shift.per-set.frag.out $TARGETDIR/hlsl.shift.per-set.frag.out || HASERROR=1 |
| 129 | |
| 130 | # |
John Kessenich | 71facdf | 2017-05-17 18:28:19 -0600 | [diff] [blame] | 131 | # Testing location error |
| 132 | # |
| 133 | echo Testing SPV no location |
| 134 | $EXE -V -C spv.noLocation.vert > $TARGETDIR/spv.noLocation.vert.out |
John Kessenich | 121853f | 2017-05-31 17:11:16 -0600 | [diff] [blame] | 135 | diff -b $BASEDIR/spv.noLocation.vert.out $TARGETDIR/spv.noLocation.vert.out || HASERROR=1 |
John Kessenich | 82e95a3 | 2017-08-26 15:47:25 -0600 | [diff] [blame] | 136 | $EXE -G -H --aml spv.noBuiltInLoc.vert > $TARGETDIR/spv.noBuiltInLoc.vert.out |
John Kessenich | 91e69c0 | 2017-07-14 05:52:31 -0600 | [diff] [blame] | 137 | diff -b $BASEDIR/spv.noBuiltInLoc.vert.out $TARGETDIR/spv.noBuiltInLoc.vert.out || HASERROR=1 |
John Kessenich | 82e95a3 | 2017-08-26 15:47:25 -0600 | [diff] [blame] | 138 | $EXE -G spv.looseUniformNoLoc.vert > $TARGETDIR/spv.looseUniformNoLoc.vert.out |
| 139 | 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] | 140 | |
| 141 | # |
| 142 | # Testing debug information |
| 143 | # |
| 144 | echo Testing SPV Debug Information |
John Kessenich | c340425 | 2018-08-23 15:29:08 -0600 | [diff] [blame] | 145 | $EXE -g --relaxed-errors --suppress-warnings --aml --amb --hlsl-offsets --nsf --spirv-val \ |
John Kessenich | 2a27116 | 2017-07-20 20:00:36 -0600 | [diff] [blame] | 146 | -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] | 147 | diff -b $BASEDIR/spv.debugInfo.frag.out $TARGETDIR/spv.debugInfo.frag.out || HASERROR=1 |
John Kessenich | deec193 | 2019-08-13 08:00:30 -0600 | [diff] [blame^] | 148 | $EXE -g -Od --target-env vulkan1.1 --relaxed-errors --suppress-warnings --aml --amb --hlsl-offsets --nsf --spirv-val \ |
John Kessenich | 66011cb | 2018-03-06 16:12:04 -0700 | [diff] [blame] | 149 | -G -H spv.debugInfo.frag --rsb frag 3 > $TARGETDIR/spv.debugInfo.1.1.frag.out |
| 150 | diff -b $BASEDIR/spv.debugInfo.1.1.frag.out $TARGETDIR/spv.debugInfo.1.1.frag.out || HASERROR=1 |
John Kessenich | c340425 | 2018-08-23 15:29:08 -0600 | [diff] [blame] | 151 | $EXE -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] | 152 | --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] | 153 | 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] | 154 | |
| 155 | # |
John Kessenich | 3494b4d | 2017-05-22 15:00:42 -0600 | [diff] [blame] | 156 | # Testing Includer |
| 157 | # |
| 158 | echo Testing Includer |
John Kessenich | b3cff2f | 2017-12-21 12:17:25 -0700 | [diff] [blame] | 159 | $EXE -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] | 160 | diff -b $BASEDIR/hlsl.include.vert.out $TARGETDIR/hlsl.include.vert.out || HASERROR=1 |
John Kessenich | b3cff2f | 2017-12-21 12:17:25 -0700 | [diff] [blame] | 161 | $EXE -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] | 162 | diff -b $BASEDIR/hlsl.includeNegative.vert.out $TARGETDIR/hlsl.includeNegative.vert.out || HASERROR=1 |
| 163 | $EXE -l -i include.vert > $TARGETDIR/include.vert.out |
| 164 | diff -b $BASEDIR/include.vert.out $TARGETDIR/include.vert.out || HASERROR=1 |
John Kessenich | b3cff2f | 2017-12-21 12:17:25 -0700 | [diff] [blame] | 165 | $EXE -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] | 166 | diff -b $BASEDIR/hlsl.dashI.vert.out $TARGETDIR/hlsl.dashI.vert.out || HASERROR=1 |
greg-lunarg | 5d43c4a | 2018-12-07 17:36:33 -0700 | [diff] [blame] | 167 | $EXE -D -Od -e MainPs -H -Od -g hlsl.pp.line3.frag > $TARGETDIR/hlsl.pp.line3.frag.out |
| 168 | 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] | 169 | |
| 170 | # |
John Kessenich | a931366 | 2017-06-15 10:40:49 -0600 | [diff] [blame] | 171 | # Testing -D and -U |
| 172 | # |
LoopDawg | 8004d36 | 2017-09-17 10:38:52 -0600 | [diff] [blame] | 173 | echo "Testing -D and -U" |
John Kessenich | a931366 | 2017-06-15 10:40:49 -0600 | [diff] [blame] | 174 | $EXE -DUNDEFED -UIN_SHADER -DFOO=200 -i -l -UUNDEFED -DMUL=FOO*2 glsl.-D-U.frag > $TARGETDIR/glsl.-D-U.frag.out |
| 175 | diff -b $BASEDIR/glsl.-D-U.frag.out $TARGETDIR/glsl.-D-U.frag.out || HASERROR=1 |
John Kessenich | b3cff2f | 2017-12-21 12:17:25 -0700 | [diff] [blame] | 176 | $EXE -D -Od -e main -V -i -DUNDEFED -UIN_SHADER -DFOO=200 -UUNDEFED -Od hlsl.-D-U.frag > $TARGETDIR/hlsl.-D-U.frag.out |
John Kessenich | a931366 | 2017-06-15 10:40:49 -0600 | [diff] [blame] | 177 | diff -b $BASEDIR/hlsl.-D-U.frag.out $TARGETDIR/hlsl.-D-U.frag.out || HASERROR=1 |
| 178 | |
| 179 | # |
John Kessenich | 6353d55 | 2017-06-23 11:11:09 -0600 | [diff] [blame] | 180 | # Test --client and --target-env |
| 181 | # |
LoopDawg | 8004d36 | 2017-09-17 10:38:52 -0600 | [diff] [blame] | 182 | echo "Testing --client and --target-env" |
John Kessenich | 8717a5d | 2018-10-26 10:12:32 -0600 | [diff] [blame] | 183 | $EXE --client vulkan100 spv.targetVulkan.vert || HASERROR=1 |
| 184 | $EXE --client opengl100 spv.targetOpenGL.vert || HASERROR=1 |
| 185 | $EXE --target-env vulkan1.0 spv.targetVulkan.vert || HASERROR=1 |
| 186 | $EXE --target-env vulkan1.1 spv.targetVulkan.vert || HASERROR=1 |
| 187 | $EXE --target-env opengl spv.targetOpenGL.vert || HASERROR=1 |
| 188 | $EXE -V100 spv.targetVulkan.vert || HASERROR=1 |
| 189 | $EXE -G100 spv.targetOpenGL.vert || HASERROR=1 |
| 190 | $EXE --target-env spirv1.2 -V spv.targetVulkan.vert || HASERROR=1 |
John Kessenich | 6353d55 | 2017-06-23 11:11:09 -0600 | [diff] [blame] | 191 | |
| 192 | # |
John Kessenich | 9855bda | 2017-09-11 21:48:19 -0600 | [diff] [blame] | 193 | # Testing GLSL entry point rename |
| 194 | # |
LoopDawg | 8004d36 | 2017-09-17 10:38:52 -0600 | [diff] [blame] | 195 | echo "Testing GLSL entry point rename" |
John Kessenich | 9855bda | 2017-09-11 21:48:19 -0600 | [diff] [blame] | 196 | $EXE -H -e foo --source-entrypoint main glsl.entryPointRename.vert > $TARGETDIR/glsl.entryPointRename.vert.out |
| 197 | diff -b $BASEDIR/glsl.entryPointRename.vert.out $TARGETDIR/glsl.entryPointRename.vert.out || HASERROR=1 |
| 198 | $EXE -H -e foo --source-entrypoint bar glsl.entryPointRename.vert > $TARGETDIR/glsl.entryPointRename.vert.bad.out |
| 199 | diff -b $BASEDIR/glsl.entryPointRename.vert.bad.out $TARGETDIR/glsl.entryPointRename.vert.bad.out || HASERROR=1 |
| 200 | $EXE -H -e foo --source-entrypoint main glsl.entryPointRename2.vert > $TARGETDIR/glsl.entryPointRename2.vert.out |
| 201 | diff -b $BASEDIR/glsl.entryPointRename2.vert.out $TARGETDIR/glsl.entryPointRename2.vert.out || HASERROR=1 |
| 202 | |
| 203 | # |
LoopDawg | 8004d36 | 2017-09-17 10:38:52 -0600 | [diff] [blame] | 204 | # Testing remapper error handling |
| 205 | # |
| 206 | echo "Testing remapper error handling" |
| 207 | $REMAPEXE --do-everything -i remap.invalid-spirv-1.spv -o $TARGETDIR > $TARGETDIR/remap.invalid-spirv-1.out && HASERROR=1 |
| 208 | diff -b $BASEDIR/remap.invalid-spirv-1.out $TARGETDIR/remap.invalid-spirv-1.out || HASERROR=1 |
| 209 | $REMAPEXE --do-everything -i remap.invalid-spirv-2.spv -o $TARGETDIR > $TARGETDIR/remap.invalid-spirv-2.out && HASERROR=1 |
| 210 | diff -b $BASEDIR/remap.invalid-spirv-2.out $TARGETDIR/remap.invalid-spirv-2.out || HASERROR=1 |
| 211 | |
| 212 | # |
LoopDawg | b22c069 | 2017-12-06 16:52:03 -0700 | [diff] [blame] | 213 | # Testing position Y inversion |
| 214 | # |
| 215 | echo "Testing position Y inversion" |
John Kessenich | b3cff2f | 2017-12-21 12:17:25 -0700 | [diff] [blame] | 216 | $EXE -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] | 217 | diff -b $BASEDIR/hlsl.y-negate-1.vert.out $TARGETDIR/hlsl.y-negate-1.vert.out || HASERROR=1 |
John Kessenich | b3cff2f | 2017-12-21 12:17:25 -0700 | [diff] [blame] | 218 | $EXE -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] | 219 | diff -b $BASEDIR/hlsl.y-negate-2.vert.out $TARGETDIR/hlsl.y-negate-2.vert.out || HASERROR=1 |
John Kessenich | b3cff2f | 2017-12-21 12:17:25 -0700 | [diff] [blame] | 220 | $EXE -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] | 221 | diff -b $BASEDIR/hlsl.y-negate-3.vert.out $TARGETDIR/hlsl.y-negate-3.vert.out || HASERROR=1 |
| 222 | |
| 223 | # |
John Kessenich | 5d610ee | 2018-03-07 18:05:55 -0700 | [diff] [blame] | 224 | # Testing hlsl_functionality1 |
| 225 | # |
John Kessenich | 086febc | 2018-10-25 12:43:02 -0600 | [diff] [blame] | 226 | echo "Testing hlsl_functionality1" |
John Kessenich | 5d610ee | 2018-03-07 18:05:55 -0700 | [diff] [blame] | 227 | $EXE -H -e main -D -Od -fhlsl_functionality1 hlsl.structbuffer.incdec.frag > \ |
| 228 | $TARGETDIR/hlsl.structbuffer.incdec.frag.hlslfun1.out |
| 229 | diff -b $BASEDIR/hlsl.structbuffer.incdec.frag.hlslfun1.out $TARGETDIR/hlsl.structbuffer.incdec.frag.hlslfun1.out || HASERROR=1 |
John Kessenich | f52b638 | 2018-04-05 19:35:38 -0600 | [diff] [blame] | 230 | $EXE -H -e main -D -Od -fhlsl_functionality1 hlsl.noSemantic.functionality1.comp > \ |
| 231 | $TARGETDIR/hlsl.noSemantic.functionality1.comp.out |
| 232 | 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] | 233 | |
| 234 | # |
John Kessenich | 9cc81de | 2018-07-02 10:40:32 -0600 | [diff] [blame] | 235 | # Testing HLSL-specific PP feature expansion |
| 236 | # |
John Kessenich | 086febc | 2018-10-25 12:43:02 -0600 | [diff] [blame] | 237 | echo "Testing HLSL-specific PP feature expansion" |
John Kessenich | 9cc81de | 2018-07-02 10:40:32 -0600 | [diff] [blame] | 238 | $EXE -D -E hlsl.pp.expand.frag > $TARGETDIR/hlsl.pp.expand.frag.out 2> $TARGETDIR/hlsl.pp.expand.frag.err |
| 239 | diff -b $BASEDIR/hlsl.pp.expand.frag.out $TARGETDIR/hlsl.pp.expand.frag.out || HASERROR=1 |
| 240 | diff -b $BASEDIR/hlsl.pp.expand.frag.err $TARGETDIR/hlsl.pp.expand.frag.err || HASERROR=1 |
| 241 | |
| 242 | # |
John Kessenich | 605afc7 | 2019-06-17 23:33:09 -0600 | [diff] [blame] | 243 | # Test --nan-clamp |
| 244 | # |
| 245 | echo "Testing nan-clamp" |
| 246 | $EXE --nan-clamp -H --aml --amb spv.400.frag > $TARGETDIR/spv.400.frag.nanclamp.out |
| 247 | diff -b $BASEDIR/spv.400.frag.nanclamp.out $TARGETDIR/spv.400.frag.nanclamp.out || HASERROR=1 |
| 248 | |
| 249 | # |
John Kessenich | 4f1403e | 2017-04-05 17:38:20 -0600 | [diff] [blame] | 250 | # Final checking |
| 251 | # |
John Kessenich | e751bca | 2017-03-16 11:20:38 -0600 | [diff] [blame] | 252 | if [ $HASERROR -eq 0 ] |
| 253 | then |
| 254 | echo Tests Succeeded. |
| 255 | else |
| 256 | echo Tests Failed. |
| 257 | fi |
| 258 | |
John Kessenich | 4b1a890 | 2017-07-06 11:58:12 -0600 | [diff] [blame] | 259 | rm -f comp.spv frag.spv geom.spv tesc.spv tese.spv vert.spv |
| 260 | |
John Kessenich | b38c969 | 2015-05-15 19:01:17 +0000 | [diff] [blame] | 261 | exit $HASERROR |