runtests 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. #!/usr/bin/env bash
  2. # Arguments:
  3. # 1- TargetDirectory, where to write test results and intermediary files
  4. # 2- Path to glslang
  5. TARGETDIR=${1:-localResults}
  6. BASEDIR=baseResults
  7. EXE=${2:-../build/install/bin/glslang}
  8. HASERROR=0
  9. mkdir -p "$TARGETDIR"
  10. LIBPATH="$(cd "$(dirname "$(dirname "$EXE")")" && pwd)/lib"
  11. if [ -d "${LIBPATH}" ]; then
  12. export LD_LIBRARY_PATH="${LIBPATH}:${LD_LIBRARY_PATH}"
  13. fi
  14. function run {
  15. "$EXE" "$@"
  16. result=$?
  17. case "$result" in
  18. [0-6]) # Valid success and error codes
  19. return
  20. ;;
  21. *)
  22. echo "$EXE returned $result"
  23. HASERROR=1
  24. esac
  25. }
  26. if [ -a localtestlist ]
  27. then
  28. while read t; do
  29. echo Running $t...
  30. b=`basename $t`
  31. run -i -l $t > "$TARGETDIR/$b.out"
  32. diff -b $BASEDIR/$b.out "$TARGETDIR/$b.out" || HASERROR=1
  33. done < localtestlist
  34. fi
  35. rm -f comp.spv frag.spv geom.spv tesc.spv tese.spv vert.spv
  36. #
  37. # special tests
  38. #
  39. run badMacroArgs.frag > "$TARGETDIR/badMacroArgs.frag.out"
  40. diff -b $BASEDIR/badMacroArgs.frag.out "$TARGETDIR/badMacroArgs.frag.out" || HASERROR=1
  41. run gl_samplemask_array_size.frag gl_MaxSamples_32.conf -i > "$TARGETDIR/gl_samplemask_array_size_32.frag.out"
  42. diff -b $BASEDIR/gl_samplemask_array_size_32.frag.out "$TARGETDIR/gl_samplemask_array_size_32.frag.out" || HASERROR=1
  43. run gl_samplemask_array_size.frag gl_MaxSamples_64.conf -i > "$TARGETDIR/gl_samplemask_array_size_64.frag.out"
  44. diff -b $BASEDIR/gl_samplemask_array_size_64.frag.out "$TARGETDIR/gl_samplemask_array_size_64.frag.out" || HASERROR=1
  45. #
  46. # reflection tests
  47. #
  48. echo Running reflection...
  49. run -l -q -C reflection.vert > "$TARGETDIR/reflection.vert.out"
  50. diff -b $BASEDIR/reflection.vert.out "$TARGETDIR/reflection.vert.out" || HASERROR=1
  51. 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"
  52. diff -b $BASEDIR/reflection.options.vert.out "$TARGETDIR/reflection.options.vert.out" || HASERROR=1
  53. run -l -q -C reflection.frag > "$TARGETDIR/reflection.frag.out"
  54. diff -b $BASEDIR/reflection.frag.out "$TARGETDIR/reflection.frag.out" || HASERROR=1
  55. 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"
  56. diff -b $BASEDIR/reflection.options.frag.out "$TARGETDIR/reflection.options.frag.out" || HASERROR=1
  57. 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"
  58. diff -b $BASEDIR/reflection.options.geom.out "$TARGETDIR/reflection.options.geom.out" || HASERROR=1
  59. run -l -q -C reflection.linked.vert reflection.linked.frag > "$TARGETDIR/reflection.linked.out"
  60. diff -b $BASEDIR/reflection.linked.out "$TARGETDIR/reflection.linked.out" || HASERROR=1
  61. 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"
  62. diff -b $BASEDIR/reflection.linked.options.out "$TARGETDIR/reflection.linked.options.out" || HASERROR=1
  63. run -D -Od -e flizv -l -q -C -V -Od hlsl.reflection.vert > "$TARGETDIR/hlsl.reflection.vert.out"
  64. diff -b $BASEDIR/hlsl.reflection.vert.out "$TARGETDIR/hlsl.reflection.vert.out" || HASERROR=1
  65. run -D -Od -e main -l -q -C -V -Od hlsl.reflection.binding.frag > "$TARGETDIR/hlsl.reflection.binding.frag.out"
  66. diff -b $BASEDIR/hlsl.reflection.binding.frag.out "$TARGETDIR/hlsl.reflection.binding.frag.out" || HASERROR=1
  67. 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"
  68. diff -b $BASEDIR/hlsl.automap.frag.out "$TARGETDIR/hlsl.automap.frag.out" || HASERROR=1
  69. #
  70. # multi-threaded test
  71. #
  72. echo Comparing single thread to multithread for all tests in current directory...
  73. for stage in vert frag geom tesc tese comp; do
  74. run -i -C *.$stage > "$TARGETDIR/$stage.singleThread.out"
  75. run -i -C *.$stage -t > "$TARGETDIR/$stage.multiThread.out"
  76. diff "$TARGETDIR/$stage.singleThread.out" "$TARGETDIR/$stage.multiThread.out" || HASERROR=1
  77. if [ $HASERROR -eq 0 ]
  78. then
  79. rm "$TARGETDIR/$stage.singleThread.out"
  80. rm "$TARGETDIR/$stage.multiThread.out"
  81. fi
  82. done
  83. #
  84. # entry point renaming tests
  85. #
  86. echo Running entry-point renaming tests
  87. 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"
  88. diff -b $BASEDIR/hlsl.entry.rename.frag.out "$TARGETDIR/hlsl.entry.rename.frag.out" || HASERROR=1
  89. #
  90. # Testing ill-defined uncalled function
  91. #
  92. echo Running ill-defined uncalled function
  93. run -D -Od -e main -H -Od hlsl.deadFunctionMissingBody.vert > "$TARGETDIR/hlsl.deadFunctionMissingBody.vert.out"
  94. diff -b $BASEDIR/hlsl.deadFunctionMissingBody.vert.out "$TARGETDIR/hlsl.deadFunctionMissingBody.vert.out" || HASERROR=1
  95. if [ $HASERROR -eq 0 ]
  96. then
  97. echo Tests Succeeded.
  98. else
  99. echo Tests Failed.
  100. fi
  101. #
  102. # Testing -S and compound suffixes
  103. #
  104. echo Running explicit stage test and compound suffix tests
  105. run -Od -i -S vert nosuffix > "$TARGETDIR/nosuffix.out"
  106. diff -b $BASEDIR/nosuffix.out "$TARGETDIR/nosuffix.out" || HASERROR=1
  107. run -Od -i compoundsuffix.vert.glsl > "$TARGETDIR/compoundsuffix.vert.glsl"
  108. diff -b $BASEDIR/compoundsuffix.vert.glsl "$TARGETDIR/compoundsuffix.vert.glsl" || HASERROR=1
  109. run -Od -e main -H compoundsuffix.frag.hlsl > "$TARGETDIR/compoundsuffix.frag.hlsl"
  110. diff -b $BASEDIR/compoundsuffix.frag.hlsl "$TARGETDIR/compoundsuffix.frag.hlsl" || HASERROR=1
  111. #
  112. # Testing --hlsl-offsets
  113. #
  114. echo Running hlsl offsets
  115. run -i --hlsl-offsets -H spv.hlslOffsets.vert > "$TARGETDIR/spv.hlslOffsets.vert.out"
  116. diff -b $BASEDIR/spv.hlslOffsets.vert.out "$TARGETDIR/spv.hlslOffsets.vert.out" || HASERROR=1
  117. echo Running hlsl offsets
  118. run -i --hlsl-offsets -D -Od -e main -H -Od hlsl.hlslOffset.vert > "$TARGETDIR/hlsl.hlslOffset.vert.out"
  119. diff -b $BASEDIR/hlsl.hlslOffset.vert.out "$TARGETDIR/hlsl.hlslOffset.vert.out" || HASERROR=1
  120. #
  121. # Testing --resource-set-binding
  122. #
  123. echo Configuring HLSL descriptor set and binding number manually
  124. 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"
  125. diff -b $BASEDIR/hlsl.multiDescriptorSet.frag.out "$TARGETDIR/hlsl.multiDescriptorSet.frag.out" || HASERROR=1
  126. 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"
  127. diff -b $BASEDIR/hlsl.explicitDescriptorSet.frag.out "$TARGETDIR/hlsl.explicitDescriptorSet.frag.out" || HASERROR=1
  128. 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"
  129. diff -b $BASEDIR/hlsl.explicitDescriptorSet-2.frag.out "$TARGETDIR/hlsl.explicitDescriptorSet-2.frag.out" || HASERROR=1
  130. #
  131. # Testing per-descriptor-set IO map shift
  132. #
  133. echo 'Testing per-descriptor-set IO map shift'
  134. 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
  135. diff -b $BASEDIR/hlsl.shift.per-set.frag.out "$TARGETDIR/hlsl.shift.per-set.frag.out" || HASERROR=1
  136. #
  137. # Testing location error
  138. #
  139. echo Testing SPV no location
  140. run -V -C spv.noLocation.vert > "$TARGETDIR/spv.noLocation.vert.out"
  141. diff -b $BASEDIR/spv.noLocation.vert.out "$TARGETDIR/spv.noLocation.vert.out" || HASERROR=1
  142. run -G -H --aml spv.noBuiltInLoc.vert > "$TARGETDIR/spv.noBuiltInLoc.vert.out"
  143. diff -b $BASEDIR/spv.noBuiltInLoc.vert.out "$TARGETDIR/spv.noBuiltInLoc.vert.out" || HASERROR=1
  144. run -G spv.looseUniformNoLoc.vert > "$TARGETDIR/spv.looseUniformNoLoc.vert.out"
  145. diff -b $BASEDIR/spv.looseUniformNoLoc.vert.out "$TARGETDIR/spv.looseUniformNoLoc.vert.out" || HASERROR=1
  146. #
  147. # Testing debug information
  148. #
  149. echo Testing SPV Debug Information
  150. run -g --relaxed-errors --suppress-warnings --aml --amb --hlsl-offsets --nsf --spirv-val \
  151. -G -H spv.debugInfo.frag --rsb frag 3 > "$TARGETDIR/spv.debugInfo.frag.out"
  152. diff -b $BASEDIR/spv.debugInfo.frag.out "$TARGETDIR/spv.debugInfo.frag.out" || HASERROR=1
  153. run -g -Od --target-env vulkan1.1 --relaxed-errors --suppress-warnings --aml --amb --hlsl-offsets --nsf --spirv-val \
  154. -V -H spv.debugInfo.frag --rsb frag 3 > "$TARGETDIR/spv.debugInfo.1.1.frag.out"
  155. diff -b $BASEDIR/spv.debugInfo.1.1.frag.out "$TARGETDIR/spv.debugInfo.1.1.frag.out" || HASERROR=1
  156. 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 \
  157. --sep origMain -H -Od spv.hlslDebugInfo.vert --rsb vert t0 0 0 > "$TARGETDIR/spv.hlslDebugInfo.frag.out"
  158. diff -b $BASEDIR/spv.hlslDebugInfo.frag.out "$TARGETDIR/spv.hlslDebugInfo.frag.out" || HASERROR=1
  159. #
  160. # Testing Includer
  161. #
  162. echo Testing Includer
  163. run -D -Od -e main -H -Od ../Test/hlsl.include.vert > "$TARGETDIR/hlsl.include.vert.out"
  164. diff -b $BASEDIR/hlsl.include.vert.out "$TARGETDIR/hlsl.include.vert.out" || HASERROR=1
  165. run -D -Od -e main -H -Od hlsl.includeNegative.vert > "$TARGETDIR/hlsl.includeNegative.vert.out"
  166. diff -b $BASEDIR/hlsl.includeNegative.vert.out "$TARGETDIR/hlsl.includeNegative.vert.out" || HASERROR=1
  167. run -l -i include.vert > "$TARGETDIR/include.vert.out"
  168. diff -b $BASEDIR/include.vert.out "$TARGETDIR/include.vert.out" || HASERROR=1
  169. run -D -Od -e main -H -Od -Iinc1/path1 -Iinc1/path2 hlsl.dashI.vert > "$TARGETDIR/hlsl.dashI.vert.out"
  170. diff -b $BASEDIR/hlsl.dashI.vert.out "$TARGETDIR/hlsl.dashI.vert.out" || HASERROR=1
  171. run -D -Od -e MainPs -H -Od -g hlsl.pp.line3.frag > "$TARGETDIR/hlsl.pp.line3.frag.out"
  172. diff -b $BASEDIR/hlsl.pp.line3.frag.out "$TARGETDIR/hlsl.pp.line3.frag.out" || HASERROR=1
  173. #
  174. # Testing --depfile
  175. #
  176. echo "Testing --depfile"
  177. run -D -Od -e main -H --depfile "$TARGETDIR/hlsl.include.vert.d.out" -Od ../Test/hlsl.include.vert > "$TARGETDIR/hlsl.include.vert.out"
  178. diff -b $BASEDIR/hlsl.include.vert.d.out "$TARGETDIR/hlsl.include.vert.d.out" || HASERROR=1
  179. 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"
  180. diff -b $BASEDIR/hlsl.dashI.vert.d.out "$TARGETDIR/hlsl.dashI.vert.d.out" || HASERROR=1
  181. #
  182. # Testing -D, -U and -P
  183. #
  184. echo "Testing -D, -U and -P"
  185. 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"
  186. diff -b $BASEDIR/glsl.-D-U.frag.out "$TARGETDIR/glsl.-D-U.frag.out" || HASERROR=1
  187. 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"
  188. diff -b $BASEDIR/hlsl.-D-U.frag.out "$TARGETDIR/hlsl.-D-U.frag.out" || HASERROR=1
  189. run -P"#define TEST1" -i -l --preamble-text "#define TEST2" --p "#define TEST3" glsl.-P.frag > "$TARGETDIR/glsl.-P.frag.out"
  190. diff -b $BASEDIR/glsl.-P.frag.out "$TARGETDIR/glsl.-P.frag.out" || HASERROR=1
  191. run -i -l --preamble-text "vec4 getColor() { return vec4(1.0); }" glsl.-P.function.frag > "$TARGETDIR/glsl.-P.function.frag.out"
  192. diff -b $BASEDIR/glsl.-P.function.frag.out "$TARGETDIR/glsl.-P.function.frag.out" || HASERROR=1
  193. run -i -l --preamble-text "#extension GL_GOOGLE_include_directive : require" -I. glsl.-P.include.frag > "$TARGETDIR/glsl.-P.include.frag.out"
  194. diff -b $BASEDIR/glsl.-P.include.frag.out "$TARGETDIR/glsl.-P.include.frag.out" || HASERROR=1
  195. #
  196. # Test --client and --target-env
  197. #
  198. echo "Testing --client and --target-env"
  199. run --client vulkan100 spv.targetVulkan.vert || HASERROR=1
  200. run --client opengl100 spv.targetOpenGL.vert || HASERROR=1
  201. run --target-env vulkan1.0 spv.targetVulkan.vert || HASERROR=1
  202. run --target-env vulkan1.1 spv.targetVulkan.vert || HASERROR=1
  203. run --target-env vulkan1.2 spv.targetVulkan.vert || HASERROR=1
  204. run --target-env opengl spv.targetOpenGL.vert || HASERROR=1
  205. run -V100 spv.targetVulkan.vert || HASERROR=1
  206. run -G100 spv.targetOpenGL.vert || HASERROR=1
  207. run --target-env spirv1.2 -V spv.targetVulkan.vert || HASERROR=1
  208. #
  209. # Testing GLSL entry point rename
  210. #
  211. echo "Testing GLSL entry point rename"
  212. run -H -e foo --source-entrypoint main glsl.entryPointRename.vert > "$TARGETDIR/glsl.entryPointRename.vert.out"
  213. diff -b $BASEDIR/glsl.entryPointRename.vert.out "$TARGETDIR/glsl.entryPointRename.vert.out" || HASERROR=1
  214. run -H -e foo --source-entrypoint bar glsl.entryPointRename.vert > "$TARGETDIR/glsl.entryPointRename.vert.bad.out"
  215. diff -b $BASEDIR/glsl.entryPointRename.vert.bad.out "$TARGETDIR/glsl.entryPointRename.vert.bad.out" || HASERROR=1
  216. run -H -e foo --source-entrypoint main glsl.entryPointRename2.vert > "$TARGETDIR/glsl.entryPointRename2.vert.out"
  217. diff -b $BASEDIR/glsl.entryPointRename2.vert.out "$TARGETDIR/glsl.entryPointRename2.vert.out" || HASERROR=1
  218. #
  219. # Testing position Y inversion
  220. #
  221. echo "Testing position Y inversion"
  222. run -H -e main -V -D -Od -H -i --iy hlsl.y-negate-1.vert > "$TARGETDIR/hlsl.y-negate-1.vert.out"
  223. diff -b $BASEDIR/hlsl.y-negate-1.vert.out "$TARGETDIR/hlsl.y-negate-1.vert.out" || HASERROR=1
  224. run -H -e main -V -D -Od -H -i --invert-y hlsl.y-negate-2.vert > "$TARGETDIR/hlsl.y-negate-2.vert.out"
  225. diff -b $BASEDIR/hlsl.y-negate-2.vert.out "$TARGETDIR/hlsl.y-negate-2.vert.out" || HASERROR=1
  226. run -H -e main -V -D -Od -H -i --invert-y hlsl.y-negate-3.vert > "$TARGETDIR/hlsl.y-negate-3.vert.out"
  227. diff -b $BASEDIR/hlsl.y-negate-3.vert.out "$TARGETDIR/hlsl.y-negate-3.vert.out" || HASERROR=1
  228. #
  229. # Testing position W reciprocal
  230. #
  231. echo "Testing position W reciprocal"
  232. run -H -e main -V -D -Od -H -i --hlsl-dx-position-w hlsl.w-recip.frag > "$TARGETDIR/hlsl.w-recip.frag.out"
  233. diff -b $BASEDIR/hlsl.w-recip.frag.out "$TARGETDIR/hlsl.w-recip.frag.out" || HASERROR=1
  234. run -H -e main -V -D -Od -H -i --hlsl-dx-position-w hlsl.w-recip2.frag > "$TARGETDIR/hlsl.w-recip2.frag.out"
  235. diff -b $BASEDIR/hlsl.w-recip2.frag.out "$TARGETDIR/hlsl.w-recip2.frag.out" || HASERROR=1
  236. #
  237. # Testing hlsl_functionality1
  238. #
  239. echo "Testing hlsl_functionality1"
  240. run -H -e main -D -Od -fhlsl_functionality1 hlsl.structbuffer.incdec.frag > \
  241. "$TARGETDIR/hlsl.structbuffer.incdec.frag.hlslfun1.out"
  242. diff -b $BASEDIR/hlsl.structbuffer.incdec.frag.hlslfun1.out "$TARGETDIR/hlsl.structbuffer.incdec.frag.hlslfun1.out" || HASERROR=1
  243. run -H -e main -D -Od -fhlsl_functionality1 hlsl.noSemantic.functionality1.comp > \
  244. "$TARGETDIR/hlsl.noSemantic.functionality1.comp.out"
  245. diff -b $BASEDIR/hlsl.noSemantic.functionality1.comp.out "$TARGETDIR/hlsl.noSemantic.functionality1.comp.out" || HASERROR=1
  246. #
  247. # Testing HLSL-specific PP feature expansion
  248. #
  249. echo "Testing HLSL-specific PP feature expansion"
  250. run -D -E hlsl.pp.expand.frag > "$TARGETDIR/hlsl.pp.expand.frag.out" 2> "$TARGETDIR/hlsl.pp.expand.frag.err"
  251. diff -b $BASEDIR/hlsl.pp.expand.frag.out "$TARGETDIR/hlsl.pp.expand.frag.out" || HASERROR=1
  252. diff -b $BASEDIR/hlsl.pp.expand.frag.err "$TARGETDIR/hlsl.pp.expand.frag.err" || HASERROR=1
  253. #
  254. # Test --nan-clamp
  255. #
  256. echo "Testing nan-clamp"
  257. run --nan-clamp -H --aml --amb spv.400.frag > "$TARGETDIR/spv.400.frag.nanclamp.out"
  258. diff -b $BASEDIR/spv.400.frag.nanclamp.out "$TARGETDIR/spv.400.frag.nanclamp.out" || HASERROR=1
  259. #
  260. # Test --auto-sampled-textures
  261. #
  262. echo "Testing auto-sampled-textures"
  263. run --auto-sampled-textures -H -Od -e MainPs -D -S frag hlsl.autosampledtextures.frag > "$TARGETDIR/hlsl.autosampledtextures.frag.out"
  264. diff -b $BASEDIR/hlsl.autosampledtextures.frag.out "$TARGETDIR/hlsl.autosampledtextures.frag.out" || HASERROR=1
  265. run --auto-sampled-textures -H -Od -S frag glsl.autosampledtextures.frag > "$TARGETDIR/glsl.autosampledtextures.frag.out"
  266. diff -b $BASEDIR/glsl.autosampledtextures.frag.out "$TARGETDIR/glsl.autosampledtextures.frag.out" || HASERROR=1
  267. # Test --glsl-version
  268. #
  269. echo "Testing --glsl-version"
  270. run --glsl-version 410 -V -S vert glsl.versionOverride.vert > "$TARGETDIR/glsl.versionOverride.vert.out"
  271. diff -b $BASEDIR/glsl.versionOverride.vert.out "$TARGETDIR/glsl.versionOverride.vert.out" || HASERROR=1
  272. run --glsl-version 420 -V -S frag glsl.versionOverride.frag > "$TARGETDIR/glsl.versionOverride.frag.out"
  273. diff -b $BASEDIR/glsl.versionOverride.frag.out "$TARGETDIR/glsl.versionOverride.frag.out" || HASERROR=1
  274. run --glsl-version 430 -V -S geom glsl.versionOverride.geom > "$TARGETDIR/glsl.versionOverride.geom.out"
  275. diff -b $BASEDIR/glsl.versionOverride.geom.out "$TARGETDIR/glsl.versionOverride.geom.out" || HASERROR=1
  276. run --glsl-version 440 -V -S tesc glsl.versionOverride.tesc > "$TARGETDIR/glsl.versionOverride.tesc.out"
  277. diff -b $BASEDIR/glsl.versionOverride.tesc.out "$TARGETDIR/glsl.versionOverride.tesc.out" || HASERROR=1
  278. run --glsl-version 450 -V -S tese glsl.versionOverride.tese > "$TARGETDIR/glsl.versionOverride.tese.out"
  279. diff -b $BASEDIR/glsl.versionOverride.tese.out "$TARGETDIR/glsl.versionOverride.tese.out" || HASERROR=1
  280. run --glsl-version 460 -V -S comp glsl.versionOverride.comp > "$TARGETDIR/glsl.versionOverride.comp.out"
  281. diff -b $BASEDIR/glsl.versionOverride.comp.out "$TARGETDIR/glsl.versionOverride.comp.out" || HASERROR=1
  282. #
  283. # Test --enhanced-msgs
  284. #
  285. echo "Testing enhanced-msgs"
  286. run --enhanced-msgs -V --target-env vulkan1.2 --amb --aml enhanced.0.frag > "$TARGETDIR/enhanced.0.frag.out"
  287. diff -b $BASEDIR/enhanced.0.frag.out "$TARGETDIR/enhanced.0.frag.out" || HASERROR=1
  288. run --enhanced-msgs -V --target-env vulkan1.2 --amb --aml enhanced.1.frag > "$TARGETDIR/enhanced.1.frag.out"
  289. diff -b $BASEDIR/enhanced.1.frag.out "$TARGETDIR/enhanced.1.frag.out" || HASERROR=1
  290. run --enhanced-msgs -V --target-env vulkan1.2 --amb --aml enhanced.2.frag > "$TARGETDIR/enhanced.2.frag.out"
  291. diff -b $BASEDIR/enhanced.2.frag.out "$TARGETDIR/enhanced.2.frag.out" || HASERROR=1
  292. run --enhanced-msgs -V --target-env vulkan1.2 --amb --aml enhanced.3.vert enhanced.3.frag > "$TARGETDIR/enhanced.3.link.out"
  293. diff -b $BASEDIR/enhanced.3.link.out "$TARGETDIR/enhanced.3.link.out" || HASERROR=1
  294. run --enhanced-msgs -V --target-env vulkan1.2 --amb --aml enhanced.4.vert enhanced.4.frag > "$TARGETDIR/enhanced.4.link.out"
  295. diff -b $BASEDIR/enhanced.4.link.out "$TARGETDIR/enhanced.4.link.out" || HASERROR=1
  296. run --enhanced-msgs -V --target-env vulkan1.2 --amb --aml enhanced.5.vert enhanced.5.frag > "$TARGETDIR/enhanced.5.link.out"
  297. diff -b $BASEDIR/enhanced.5.link.out "$TARGETDIR/enhanced.5.link.out" || HASERROR=1
  298. run --enhanced-msgs -V --target-env vulkan1.2 --amb --aml enhanced.6.vert enhanced.6.frag > "$TARGETDIR/enhanced.6.link.out"
  299. diff -b $BASEDIR/enhanced.6.link.out "$TARGETDIR/enhanced.6.link.out" || HASERROR=1
  300. run --enhanced-msgs -V --target-env vulkan1.2 --amb --aml enhanced.7.vert enhanced.7.frag > "$TARGETDIR/enhanced.7.link.out"
  301. diff -b $BASEDIR/enhanced.7.link.out "$TARGETDIR/enhanced.7.link.out" || HASERROR=1
  302. run --enhanced-msgs -V --target-env vulkan1.2 --amb --aml spv.textureError.frag > "$TARGETDIR/spv.textureError.frag.out"
  303. diff -b $BASEDIR/spv.textureError.frag.out "$TARGETDIR/spv.textureError.frag.out" || HASERROR=1
  304. #
  305. # Test error column
  306. #
  307. echo "Testing error-column"
  308. run --error-column -C -V error-column.vert > "$TARGETDIR/error-column.vert.out"
  309. diff -b $BASEDIR/error-column.vert.out $TARGETDIR/error-column.vert.out || HASERROR=1
  310. #
  311. # Test UTF8BOM
  312. #
  313. echo "Testing UTF8BOM"
  314. run --glsl-version 410 -V -S vert UTF8BOM.vert > $TARGETDIR/UTF8BOM.vert.out
  315. diff -b $BASEDIR/UTF8BOM.vert.out $TARGETDIR/UTF8BOM.vert.out || HASERROR=1
  316. #
  317. # Test LTO
  318. #
  319. echo "Testing link-time optimization"
  320. run -V -H --amb --aml -l --lto link.crossStageOptimization.vert link.crossStageOptimization.frag > "$TARGETDIR/link.crossStageOptimization.out"
  321. diff -b $BASEDIR/link.crossStageOptimization.out "$TARGETDIR/link.crossStageOptimization.out" || HASERROR=1
  322. #
  323. # Final checking
  324. #
  325. if [ $HASERROR -eq 0 ]
  326. then
  327. echo Tests Succeeded.
  328. else
  329. echo Tests Failed.
  330. fi
  331. rm -f comp.spv frag.spv geom.spv tesc.spv tese.spv vert.spv
  332. exit $HASERROR