• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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:: This is not a great mapping to GEN but the compiler is not cooperating
26::
27
28%HS_GEN% -v -a "glsl" -D HS_INTEL_GEN8 -t 2 -w 8 -r 16 -s 21504 -S 65536 -b 16 -B 48 -m 1 -M 1 -f 1 -F 1 -c 1 -C 1 -z
29
30::
31:: This should be the proper mapping onto the Intel GEN8+ subslices but the compiler is spilling
32::
33:: %HS_GEN% -v -a "glsl" -D HS_INTEL_GEN8 -t 2 -w 8 -r 16 -s 32768 -S 65536 -b 28 -B 56 -m 1 -M 1 -f 0 -F 0 -c 0 -C 0 -z
34::
35
36::
37:: remove trailing whitespace from generated files
38::
39
40sed -i 's/[[:space:]]*$//' hs_config.h
41sed -i 's/[[:space:]]*$//' hs_modules.h
42
43::
44::
45::
46
47where glslangValidator
48
49::
50:: FIXME -- convert this to a bash script
51::
52:: Note that we can use xargs instead of the cmd for/do
53::
54
55for %%f in (*.comp) do (
56    dos2unix %%f
57    clang-format -style=Mozilla -i %%f                                   || goto :error
58    cl -I ../.. -I ../../.. -EP %%f -P -Fi%%~nf.pre.comp                 || goto :error
59    clang-format -style=Mozilla -i %%~nf.pre.comp                        || goto :error
60    glslangValidator --target-env vulkan1.1 -o %%~nf.spv %%~nf.pre.comp  || goto :error
61    spirv-opt -O %%~nf.spv -o %%~nf.spv                                  || goto :error
62REM spirv-remap ...                                                      || goto :error
63    xxd -i < %%~nf.spv > %%~nf.spv.xxd                                   || goto :error
64    for /f %%A in ('wc -c %%~nf.spv') do (
65        echo %%~nf.spv %%A
66        printf "%%.8x" %%A | xxd -r -p | xxd -i > %%~nf.len.xxd          || goto :error
67    )
68)
69
70::
71:: dump a binary
72::
73
74cl -I ../../.. -I ../../../../.. /DHS_DUMP /Fe:hs_dump.exe *.c
75hs_dump
76
77::
78:: delete temporary files
79::
80
81del *.pre.comp
82del *.comp
83del *.spv
84REM del *.obj
85REM del *.exe
86
87exit /b 0
88
89:error
90
91exit /b %errorlevel%
92