gfx stack update
[nyanlinux.git] / builders / mesa-vulkan-amd-sh-5bbeb8f5075983da9ed102ff8b665e1907949ddd / contrib / generators.sh
blobfd0db58ef0ef59821db8fce6e938d7e0d2ddbc3c
1 #===============================================================================
2 # removing the braindamaged qsort class
3 cp -f $src_dir/src/compiler/nir/nir.c $src_dir/src/compiler/nir/nir.BK.c
4 sed -i $src_dir/src/compiler/nir/nir.c \
5 -e '/u_qsort.h/ d' \
6 -e 's/util_qsort_r/qsort_r/' &
7 cp -f $src_dir/src/util/mesa_cache_db.c $src_dir/src/util/mesa_cache_db.BK.c
8 sed -i $src_dir/src/util/mesa_cache_db.c \
9 -e '/u_qsort.h/ d' \
10 -e 's/util_qsort_r/qsort_r/' &
11 #===============================================================================
12 # that compute radix sort implementation ... OMFG! Text book what NOT to do.
13 # Where is the plain and simple C coded spir-v assembler for those shaders?
14 # blame: Konstantin Seurer
15 mkdir -p $build_dir/src/amd/vulkan
16 cp -f $src_dir/src/amd/vulkan/radv_meta.c $build_dir/src/amd/vulkan
17 patch -p 1 -i $src_dir/contrib/radv_meta.c.patch
18 cp -f $src_dir/src/amd/vulkan/radv_device.c $build_dir/src/amd/vulkan
19 patch -p 1 -i $src_dir/contrib/radv_device.c.patch
20 # dudes... tracers should be cleanly compilable out... smells forced corpo crap
21 cp -f $src_dir/contrib/radv_no_tracers.c $build_dir/src/amd/vulkan
22 #===============================================================================
23 # vulkan util
24 export PYTHONPATH=$mako
25 $python3 $src_dir/src/vulkan/util/gen_enum_to_str.py \
26 --xml $vulkan_api_xml \
27 --outdir $build_dir
29 # our ndebug/release version
30 cp -f $src_dir/contrib/vk_enum_to_str.c $src_dir/contrib/vk_enum_to_str.h \
31 $build_dir
32 mkdir -p $build_dir/vulkan/util
33 mv $build_dir/vk_enum_defines.h $build_dir/vulkan/util &
35 $python3 $src_dir/src/vulkan/util/vk_dispatch_table_gen.py \
36 --xml $vulkan_api_xml \
37 --out-c vk_dispatch_table.c \
38 --out-h $build_dir/vulkan/util/vk_dispatch_table.h &
39 $python3 $src_dir/src/vulkan/util/vk_extensions_gen.py \
40 --xml $vulkan_api_xml \
41 --out-c vk_extensions.c \
42 --out-h vk_extensions.h &
44 $python3 $src_dir/src/compiler/nir/nir_builder_opcodes_h.py \
45 >$build_dir/nir_builder_opcodes.h &
47 $python3 $src_dir/src/compiler/nir/nir_opcodes_h.py \
48 >$build_dir/nir_opcodes.h &
50 $python3 $src_dir/src/compiler/nir/nir_intrinsics_h.py \
51 --outdir $build_dir &
53 $python3 $src_dir/src/compiler/nir/nir_intrinsics_indices_h.py \
54 --outdir $build_dir &
55 unset PYTHONPATH
56 #===============================================================================
57 # vulkan runtime
58 export PYTHONPATH=$mako
59 $python3 $src_dir/src/vulkan/util/vk_entrypoints_gen.py \
60 --xml $vulkan_api_xml \
61 --proto --weak \
62 --out-h vk_common_entrypoints.h \
63 --out-c vk_common_entrypoints.c \
64 --prefix vk_common &
65 $python3 $src_dir/src/vulkan/util/vk_entrypoints_gen.py \
66 --xml $vulkan_api_xml \
67 --proto --weak \
68 --out-h vk_cmd_enqueue_entrypoints.h \
69 --out-c vk_cmd_enqueue_entrypoints.c \
70 --prefix vk_cmd_enqueue &
71 $python3 $src_dir/src/vulkan/util/vk_cmd_queue_gen.py \
72 --xml $vulkan_api_xml \
73 --out-h vk_cmd_queue.h \
74 --out-c vk_cmd_queue.c &
75 $python3 $src_dir/src/vulkan/util/vk_dispatch_trampolines_gen.py \
76 --xml $vulkan_api_xml \
77 --out-h vk_dispatch_trampolines.h \
78 --out-c vk_dispatch_trampolines.c &
79 $python3 $src_dir/src/vulkan/runtime/vk_physical_device_features.py \
80 --xml $vulkan_api_xml \
81 --out-c vk_physical_device_features.c &
82 $python3 $src_dir/src/vulkan/runtime/vk_format_info_gen.py \
83 --xml $vulkan_api_xml \
84 --out-h vk_format_info.h \
85 --out-c vk_format_info.c &
86 unset PYTHONPATH
87 #===============================================================================
88 # wsi x11 (Window System Interface)
89 export PYTHONPATH=$mako
90 $python3 $src_dir/src/vulkan/util/vk_entrypoints_gen.py \
91 --xml $vulkan_api_xml \
92 --proto --weak \
93 --out-h wsi_common_entrypoints.h \
94 --out-c wsi_common_entrypoints.c \
95 --prefix wsi &
96 unset PYTHONPATH
97 #===============================================================================
98 # amd common archive
99 $python3 $src_dir/src/amd/common/sid_tables.py \
100 $src_dir/src/amd/common/sid.h \
101 $src_dir/src/amd/registers/gfx6.json \
102 $src_dir/src/amd/registers/gfx7.json \
103 $src_dir/src/amd/registers/gfx8.json \
104 $src_dir/src/amd/registers/gfx81.json \
105 $src_dir/src/amd/registers/gfx9.json \
106 $src_dir/src/amd/registers/gfx10.json \
107 $src_dir/src/amd/registers/gfx10-rsrc.json \
108 $src_dir/src/amd/registers/gfx103.json \
109 $src_dir/src/amd/registers/gfx11.json \
110 $src_dir/src/amd/registers/gfx11-rsrc.json \
111 $src_dir/src/amd/registers/pkt3.json \
112 $src_dir/src/amd/registers/registers-manually-defined.json \
113 >$build_dir/sid_tables.h &
114 mkdir -p $build_dir/src/amd/common
115 $python3 $src_dir/src/amd/registers/makeregheader.py \
116 $src_dir/src/amd/registers/gfx6.json \
117 $src_dir/src/amd/registers/gfx7.json \
118 $src_dir/src/amd/registers/gfx8.json \
119 $src_dir/src/amd/registers/gfx81.json \
120 $src_dir/src/amd/registers/gfx9.json \
121 $src_dir/src/amd/registers/gfx10.json \
122 $src_dir/src/amd/registers/gfx10-rsrc.json \
123 $src_dir/src/amd/registers/gfx11.json \
124 $src_dir/src/amd/registers/gfx11-rsrc.json \
125 $src_dir/src/amd/registers/gfx103.json \
126 $src_dir/src/amd/registers/pkt3.json \
127 $src_dir/src/amd/registers/registers-manually-defined.json \
128 --sort address \
129 --guard AMDGFXREGS_H \
130 >$build_dir/src/amd/common/amdgfxregs.h &
131 #===============================================================================
132 # libcompiler required by libnir
133 export PYTHONPATH=$mako
134 $python3 $src_dir/src/compiler/glsl/ir_expression_operation.py enum \
135 >$build_dir/ir_expression_operation.h &
136 unset PYTHONPATH
137 #===============================================================================
138 # libnir
139 export PYTHONPATH=$mako
140 $python3 $src_dir/src/compiler/spirv/spirv_info_c.py \
141 $src_dir/src/compiler/spirv/spirv.core.grammar.json \
142 $build_dir/spirv_info.c &
144 $python3 $src_dir/src/compiler/spirv/vtn_gather_types_c.py \
145 $src_dir/src/compiler/spirv/spirv.core.grammar.json \
146 $build_dir/vtn_gather_types.c &
148 $python3 $src_dir/src/compiler/spirv/vtn_generator_ids_h.py \
149 $src_dir/src/compiler/spirv/spir-v.xml \
150 $build_dir/vtn_generator_ids.h &
151 # nir generated files
152 $python3 $src_dir/src/compiler/nir/nir_constant_expressions.py \
153 >$build_dir/nir_constant_expressions.c &
155 $python3 $src_dir/src/compiler/nir/nir_opt_algebraic.py \
156 >$build_dir/nir_opt_algebraic.c &
158 $python3 $src_dir/src/compiler/nir/nir_opcodes_c.py \
159 >$build_dir/nir_opcodes.c &
161 $python3 $src_dir/src/compiler/nir/nir_intrinsics_c.py \
162 --outdir $build_dir &
163 unset PYTHONPATH
164 #===============================================================================
165 # libaco
166 export PYTHONPATH=$mako
167 $python3 $src_dir/src/amd/compiler/aco_opcodes_h.py \
168 >$build_dir/aco_opcodes.h &
169 $python3 $src_dir/src/amd/compiler/aco_opcodes_cpp.py \
170 >$build_dir/aco_opcodes.cpp &
171 $python3 $src_dir/src/amd/compiler/aco_builder_h.py \
172 >$build_dir/aco_builder.h &
173 unset PYTHONPATH
174 #===============================================================================
175 # libmesautils
176 mkdir -p $build_dir/src/util
178 export PYTHONPATH=$mako
179 $python3 $src_dir/src/util/format_srgb.py \
180 >$build_dir/format_srgb.c
182 $python3 $src_dir/src/util/format/u_format_table.py \
183 $src_dir/src/util/format/u_format.csv \
184 >$build_dir/u_format_table.c
186 # wow, really?
187 mkdir -p $build_dir/src/util/format
188 $python3 $src_dir/src/util/format/u_format_table.py \
189 --header \
190 $src_dir/src/util/format/u_format.csv \
191 >$build_dir/src/util/format/u_format_pack.h
193 # oooof!
194 $python3 $src_dir/src/util/driconf_static.py \
195 $src_dir/src/util/00-mesa-defaults.conf \
196 $build_dir/src/util/driconf_static.h
197 unset PYTHONPATH
198 #$src_dir/src/util/bitset_test.cpp wtf? rotten brain?
199 #===============================================================================
200 # amd vulkan
201 export PYTHONPATH=$mako
202 #------------------------------------------------------------------------------
203 # specific API to work around _still maintained at the time of writing _ game
204 # executable... this is the beginning of the end...
205 $python3 $src_dir/src/vulkan/util/vk_entrypoints_gen.py \
206 --xml $vulkan_api_xml \
207 --proto --weak \
208 --out-h radv_entrypoints.h \
209 --out-c radv_entrypoints.c \
210 --prefix radv \
211 --device-prefix metro_exodus &
212 #------------------------------------------------------------------------------
213 #$python3 $src_dir/src/amd/vulkan/radv_extensions.py \
214 # --xml $vulkan_api_xml \
215 # --out-c radv_extensions.c \
216 # --out-h radv_extensions.h &
217 #------------------------------------------------------------------------------
218 #$python3 $src_dir/src/amd/vulkan/vk_format_table.py \
219 # $src_dir/src/amd/vulkan/vk_format_layout.csv \
220 # >$build_dir/vk_format_table.c &
221 #------------------------------------------------------------------------------
222 $python3 $src_dir/src/amd/common/gfx10_format_table.py \
223 $src_dir/src/util/format/u_format.csv \
224 $src_dir/src/amd/registers/gfx10-rsrc.json \
225 $src_dir/src/amd/registers/gfx11-rsrc.json \
226 >$build_dir/gfx10_format_table.c &
227 #------------------------------------------------------------------------------
228 git_sha1=no_git_sha1_available
229 if test -d $src_dir/.git; then
230 git_sha1=$(git --git-dir=$src_dir/.git rev-parse HEAD)
232 echo git_sha1=$git_sha1
233 echo "#define MESA_GIT_SHA1 \"$git_sha1\"" >$build_dir/git_sha1.h &
234 unset PYTHONPATH
235 #===============================================================================