1:: 2:: Copyright 2018 Google Inc. 3:: 4:: Use of this source code is governed by a BSD-style license that can 5:: be found in the LICENSE file. 6:: 7 8@ECHO OFF 9 10:: 11:: delete the previous images 12:: 13 14del *.comp 15del *.spv 16del *.xxd 17 18:: 19:: 20:: 21 22set HS_GEN=..\..\..\..\..\..\spinel\bin\x64\Debug\hs_gen 23 24:: 25:: There appears to be an Intel compiler bug when using more than 26:: 16 registers per lane so try a wider subgroup and narrower merging kernels 27:: 28:: The current crop of Intel compilers are spilling way too much... 29:: 30 31%HS_GEN% -v -a "glsl" -D HS_INTEL_GEN8 -t 1 -w 16 -r 8 -s 21504 -S 65536 -b 16 -B 48 -m 1 -M 1 -f 0 -F 0 -c 0 -C 0 -z 32 33:: 34:: This should be the proper mapping onto the Intel GEN8+ subslices but the compiler is spilling 35:: 36:: %HS_GEN% -v -a "glsl" -D HS_INTEL_GEN8 -t 1 -w 8 -r 32 -s 32768 -S 65536 -b 28 -B 56 -m 1 -M 1 -f 0 -F 0 -c 0 -C 0 -z 37:: 38 39:: 40:: remove trailing whitespace from generated files 41:: 42 43sed -i 's/[[:space:]]*$//' hs_config.h 44sed -i 's/[[:space:]]*$//' hs_modules.h 45 46:: 47:: 48:: 49 50where glslangValidator 51 52:: 53:: FIXME -- convert this to a bash script 54:: 55:: Note that we can use xargs instead of the cmd for/do 56:: 57 58for %%f in (*.comp) do ( 59 dos2unix %%f 60 clang-format -style=Mozilla -i %%f || goto :error 61 cl -I ../.. -I ../../.. -EP %%f -P -Fi%%~nf.pre.comp || goto :error 62 clang-format -style=Mozilla -i %%~nf.pre.comp || goto :error 63 glslangValidator --target-env vulkan1.1 -o %%~nf.spv %%~nf.pre.comp || goto :error 64 spirv-opt -O %%~nf.spv -o %%~nf.spv || goto :error 65REM spirv-remap ... || goto :error 66 xxd -i < %%~nf.spv > %%~nf.spv.xxd || goto :error 67 for /f %%A in ('wc -c %%~nf.spv') do ( 68 echo %%~nf.spv %%A 69 printf "%%.8x" %%A | xxd -r -p | xxd -i > %%~nf.len.xxd || goto :error 70 ) 71) 72 73:: 74:: dump a binary 75:: 76 77cl -I ../../.. -I ../../../../.. /DHS_DUMP /Fe:hs_dump.exe *.c 78hs_dump 79 80:: 81:: delete temporary files 82:: 83 84del *.pre.comp 85del *.comp 86del *.spv 87REM del *.obj 88REM del *.exe 89 90exit /b 0 91 92:error 93 94exit /b %errorlevel% 95