Home | History | Annotate | Download | only in u32
      1 #!/bin/bash
      2 
      3 ##
      4 ## Copyright 2018 Google Inc.
      5 ##
      6 ## Use of this source code is governed by a BSD-style license that can
      7 ## be found in the LICENSE file.
      8 ##
      9 
     10 ##
     11 ## exit on error
     12 ##
     13 
     14 ## set -e
     15 
     16 ##
     17 ## delete the previous images
     18 ##
     19 
     20 rm *.comp
     21 rm *.spv
     22 rm *.xxd
     23 
     24 ##
     25 ##
     26 ##
     27 
     28 HS_GEN=../../../../gen/hs_gen
     29 
     30 ## --- 32-bit keys ---
     31 
     32 $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
     33 
     34 ##
     35 ## remove trailing whitespace from generated files
     36 ##
     37 
     38 sed -i 's/[[:space:]]*$//' hs_config.h
     39 sed -i 's/[[:space:]]*$//' hs_modules.h
     40 
     41 ##
     42 ##
     43 ##
     44 
     45 whereis glslangValidator
     46 
     47 ##
     48 ## FIXME -- convert this to a bash script
     49 ##
     50 ## Note that we can use xargs instead of the cmd for/do
     51 ##
     52 
     53 for f in *.comp
     54 do
     55     dos2unix $f
     56     clang-format -style=Mozilla -i $f
     57     cpp -P -I ../.. -I ../../.. $f > ${f%%.*}.pre.comp
     58     clang-format -style=Mozilla -i ${f%%.*}.pre.comp
     59     glslangValidator --target-env vulkan1.1 -o ${f%%.*}.spv ${f%%.*}.pre.comp
     60     spirv-opt -O ${f%%.*}.spv -o ${f%%.*}.spv
     61 ##  spirv-remap -v --do-everything --input %%~nf.spv --output remap
     62     xxd -i < ${f%%.*}.spv > ${f%%.*}.spv.xxd
     63     len=$(wc -c < ${f%%.*}.spv)
     64     echo ${f%%.*}.spv $len
     65     printf "%.8x" $len | xxd -r -p | xxd -i > ${f%%.*}.len.xxd
     66 done
     67 
     68 ##
     69 ## dump a binary
     70 ##
     71 
     72 cc -I ../../.. -I ../../../../.. -D=HS_DUMP -o hs_dump *.c
     73 hs_dump
     74 
     75 ##
     76 ## delete temporary files
     77 ##
     78 
     79 rm *.pre.comp
     80 rm *.comp
     81 rm *.spv
     82