Gfx stack update
[nyanlinux.git] / builders / mesa-vulkan-amd-sh-a0877c132c3ff955717ae7f5fcaca34ca6deba54 / contrib / generators.sh
blob4e3e94de6abb8c7bfc08686cfd0dae09a8cd74a1
1 #===============================================================================
2 # removing the braindamaged qsort class
3 cp -f $src_dir/src/compiler/nir/nir.c $build_dir/src/compiler/nir/nir.c
4 sed -i $build_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 $build_dir/src/util/mesa_cache_db.c
8 sed -i $build_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 cp -f $src_dir/src/amd/vulkan/meta/radv_meta.c $build_dir/src/amd/vulkan/meta
16 patch -p 1 -i $src_dir/contrib/radv_meta.c.patch
17 cp -f $src_dir/src/amd/vulkan/meta/radv_meta_copy.c $build_dir/src/amd/vulkan/meta
18 patch -p 1 -i $src_dir/contrib/radv_meta_copy.c.patch
19 cp -f $src_dir/src/amd/vulkan/radv_device.c $build_dir/src/amd/vulkan
20 patch -p 1 -i $src_dir/contrib/radv_device.c.patch
21 # dudes... tracers should be cleanly compilable out... smells forced corpo crap
22 cp -f $src_dir/contrib/radv_no_tracers.c $build_dir/src/amd/vulkan
23 #===============================================================================
24 # vulkan util
25 export PYTHONPATH=$mako
26 $python3 $src_dir/src/vulkan/util/gen_enum_to_str.py \
27 --beta false \
28 --xml $vulkan_api_xml \
29 --outdir $build_dir/src/vulkan/util
31 # our ndebug/release version
32 cp -f $src_dir/contrib/vk_enum_to_str.c $src_dir/contrib/vk_enum_to_str.h \
33 $build_dir/src/vulkan/util
35 $python3 $src_dir/src/vulkan/util/vk_dispatch_table_gen.py \
36 --beta false \
37 --xml $vulkan_api_xml \
38 --out-c $build_dir/src/vulkan/util/vk_dispatch_table.c \
39 --out-h $build_dir/src/vulkan/util/vk_dispatch_table.h &
41 $python3 $src_dir/src/vulkan/util/vk_extensions_gen.py \
42 --xml $vulkan_api_xml \
43 --out-c $build_dir/src/vulkan/util/vk_extensions.c \
44 --out-h $build_dir/src/vulkan/util/vk_extensions.h &
46 $python3 $src_dir/src/vulkan/util/vk_struct_type_cast_gen.py \
47 --beta false \
48 --xml $vulkan_api_xml \
49 --outdir $build_dir/src/vulkan/util &
51 $python3 $src_dir/src/compiler/nir/nir_builder_opcodes_h.py \
52 >$build_dir/src/compiler/nir/nir_builder_opcodes.h &
54 $python3 $src_dir/src/compiler/nir/nir_opcodes_h.py \
55 >$build_dir/src/compiler/nir/nir_opcodes.h &
57 $python3 $src_dir/src/compiler/nir/nir_intrinsics_h.py \
58 --outdir $build_dir/src/compiler/nir &
60 $python3 $src_dir/src/compiler/nir/nir_intrinsics_indices_h.py \
61 --outdir $build_dir/src/compiler/nir &
62 unset PYTHONPATH
63 #===============================================================================
64 # vulkan layer crap
65 #export PYTHONPATH=$mako
66 #$python3 $src_dir/src/amd/vulkan/layers/radv_annotate_layer_gen.py \
67 # --xml $vulkan_api_xml \
68 # --out-c $build_dir/src/amd/vulkan/layers/radv_annotate_layer.c \
69 # --beta false
70 #unset PYTHONPATH
71 #===============================================================================
72 # vulkan runtime
73 export PYTHONPATH=$mako
74 $python3 $src_dir/src/vulkan/util/vk_entrypoints_gen.py \
75 --beta false \
76 --xml $vulkan_api_xml \
77 --proto --weak \
78 --out-h $build_dir/src/vulkan/runtime/vk_common_entrypoints.h \
79 --out-c $build_dir/src/vulkan/runtime/vk_common_entrypoints.c \
80 --prefix vk_common &
81 $python3 $src_dir/src/vulkan/util/vk_entrypoints_gen.py \
82 --beta false \
83 --xml $vulkan_api_xml \
84 --proto --weak \
85 --out-h $build_dir/src/vulkan/runtime/vk_cmd_enqueue_entrypoints.h \
86 --out-c $build_dir/src/vulkan/runtime/vk_cmd_enqueue_entrypoints.c \
87 --prefix vk_cmd_enqueue &
88 $python3 $src_dir/src/vulkan/util/vk_cmd_queue_gen.py \
89 --beta false \
90 --xml $vulkan_api_xml \
91 --out-h $build_dir/src/vulkan/runtime/vk_cmd_queue.h \
92 --out-c $build_dir/src/vulkan/runtime/vk_cmd_queue.c &
93 $python3 $src_dir/src/vulkan/util/vk_dispatch_trampolines_gen.py \
94 --beta false \
95 --xml $vulkan_api_xml \
96 --out-h $build_dir/src/vulkan/runtime/vk_dispatch_trampolines.h \
97 --out-c $build_dir/src/vulkan/runtime/vk_dispatch_trampolines.c &
98 $python3 $src_dir/src/vulkan/util/vk_physical_device_features_gen.py \
99 --beta false \
100 --xml $vulkan_api_xml \
101 --out-h $build_dir/src/vulkan/runtime/vk_physical_device_features.h \
102 --out-c $build_dir/src/vulkan/runtime/vk_physical_device_features.c &
103 $python3 $src_dir/src/vulkan/util/vk_physical_device_properties_gen.py \
104 --beta false \
105 --xml $vulkan_api_xml \
106 --out-h $build_dir/src/vulkan/runtime/vk_physical_device_properties.h \
107 --out-c $build_dir/src/vulkan/runtime/vk_physical_device_properties.c &
108 $python3 $src_dir/src/vulkan/util/vk_physical_device_spirv_caps_gen.py \
109 --beta false \
110 --xml $vulkan_api_xml \
111 --out-c $build_dir/src/vulkan/runtime/vk_physical_device_spirv_caps.c &
112 $python3 $src_dir/src/vulkan/runtime/vk_format_info_gen.py \
113 --xml $vulkan_api_xml \
114 --out-h $build_dir/src/vulkan/runtime/vk_format_info.h \
115 --out-c $build_dir/src/vulkan/runtime/vk_format_info.c &
116 $python3 $src_dir/src/vulkan/util/vk_synchronization_helpers_gen.py \
117 --beta false \
118 --xml $vulkan_api_xml \
119 --out-c $build_dir/src/vulkan/runtime/vk_synchronization_helpers.c &
120 unset PYTHONPATH
121 #===============================================================================
122 # wsi x11 (Window System Interface)
123 export PYTHONPATH=$mako
124 $python3 $src_dir/src/vulkan/util/vk_entrypoints_gen.py \
125 --beta false \
126 --xml $vulkan_api_xml \
127 --proto --weak \
128 --out-h $build_dir/src/vulkan/wsi/wsi_common_entrypoints.h \
129 --out-c $build_dir/src/vulkan/wsi/wsi_common_entrypoints.c \
130 --prefix wsi &
131 unset PYTHONPATH
132 #===============================================================================
133 # amd common archive
134 $python3 $src_dir/src/amd/common/sid_tables.py \
135 $src_dir/src/amd/common/sid.h \
136 $src_dir/src/amd/registers/gfx6.json \
137 $src_dir/src/amd/registers/gfx7.json \
138 $src_dir/src/amd/registers/gfx8.json \
139 $src_dir/src/amd/registers/gfx81.json \
140 $src_dir/src/amd/registers/gfx9.json \
141 $src_dir/src/amd/registers/gfx940.json \
142 $src_dir/src/amd/registers/gfx10.json \
143 $src_dir/src/amd/registers/gfx10-rsrc.json \
144 $src_dir/src/amd/registers/gfx103.json \
145 $src_dir/src/amd/registers/gfx11.json \
146 $src_dir/src/amd/registers/gfx115.json \
147 $src_dir/src/amd/registers/gfx11-rsrc.json \
148 $src_dir/src/amd/registers/gfx12.json \
149 $src_dir/src/amd/registers/gfx12-rsrc.json \
150 $src_dir/src/amd/registers/pkt3.json \
151 $src_dir/src/amd/registers/registers-manually-defined.json \
152 >$build_dir/src/amd/common/sid_tables.h &
153 $python3 $src_dir/src/amd/registers/makeregheader.py \
154 $src_dir/src/amd/registers/gfx6.json \
155 $src_dir/src/amd/registers/gfx7.json \
156 $src_dir/src/amd/registers/gfx8.json \
157 $src_dir/src/amd/registers/gfx81.json \
158 $src_dir/src/amd/registers/gfx9.json \
159 $src_dir/src/amd/registers/gfx940.json \
160 $src_dir/src/amd/registers/gfx10.json \
161 $src_dir/src/amd/registers/gfx10-rsrc.json \
162 $src_dir/src/amd/registers/gfx103.json \
163 $src_dir/src/amd/registers/gfx11.json \
164 $src_dir/src/amd/registers/gfx115.json \
165 $src_dir/src/amd/registers/gfx11-rsrc.json \
166 $src_dir/src/amd/registers/gfx12.json \
167 $src_dir/src/amd/registers/gfx12-rsrc.json \
168 $src_dir/src/amd/registers/pkt3.json \
169 $src_dir/src/amd/registers/registers-manually-defined.json \
170 --sort address \
171 --guard AMDGFXREGS_H \
172 >$build_dir/src/amd/common/amdgfxregs.h &
173 #===============================================================================
174 # libcompiler required by libnir
175 export PYTHONPATH=$mako
176 #------------------------------------------------------------------------------
177 $python3 $src_dir/src/compiler/glsl/ir_expression_operation.py enum \
178 >$build_dir/src/compiler/glsl/ir_expression_operation.h &
179 #------------------------------------------------------------------------------
180 $python3 $src_dir/src/compiler/builtin_types_h.py \
181 $build_dir/src/compiler/builtin_types.h &
182 #------------------------------------------------------------------------------
183 $python3 $src_dir/src/compiler/builtin_types_c.py \
184 $build_dir/src/compiler/builtin_types.c &
185 #------------------------------------------------------------------------------
186 unset PYTHONPATH
187 #===============================================================================
188 # libnir
189 export PYTHONPATH=$mako
190 $python3 $src_dir/src/compiler/spirv/spirv_info_gen.py \
191 --json $src_dir/src/compiler/spirv/spirv.core.grammar.json \
192 --out-h $build_dir/src/compiler/spirv/spirv_info.h \
193 --out-c $build_dir/src/compiler/spirv/spirv_info.c &
195 $python3 $src_dir/src/compiler/spirv/vtn_gather_types_c.py \
196 $src_dir/src/compiler/spirv/spirv.core.grammar.json \
197 $build_dir/src/compiler/spirv/vtn_gather_types.c &
199 $python3 $src_dir/src/compiler/spirv/vtn_generator_ids_h.py \
200 $src_dir/src/compiler/spirv/spir-v.xml \
201 $build_dir/src/compiler/spirv/vtn_generator_ids.h &
202 # nir generated files
203 $python3 $src_dir/src/compiler/nir/nir_constant_expressions.py \
204 >$build_dir/src/compiler/nir/nir_constant_expressions.c &
206 $python3 $src_dir/src/compiler/nir/nir_opt_algebraic.py \
207 >$build_dir/src/compiler/nir/nir_opt_algebraic.c &
209 $python3 $src_dir/src/compiler/nir/nir_opcodes_c.py \
210 >$build_dir/src/compiler/nir/nir_opcodes.c &
212 $python3 $src_dir/src/compiler/nir/nir_intrinsics_c.py \
213 --outdir $build_dir/src/compiler/nir &
214 unset PYTHONPATH
215 #===============================================================================
216 # libaco
217 export PYTHONPATH=$mako
218 $python3 $src_dir/src/amd/compiler/aco_opcodes_h.py \
219 >$build_dir/src/amd/compiler/aco_opcodes.h &
220 $python3 $src_dir/src/amd/compiler/aco_opcodes_cpp.py \
221 >$build_dir/src/amd/compiler/aco_opcodes.cpp &
222 $python3 $src_dir/src/amd/compiler/aco_builder_h.py \
223 >$build_dir/src/amd/compiler/aco_builder.h &
224 unset PYTHONPATH
225 #===============================================================================
226 # libmesautils
227 export PYTHONPATH=$mako
228 $python3 $src_dir/src/util/format_srgb.py \
229 >$build_dir/src/util/format_srgb.c
231 $python3 $src_dir/src/util/format/u_format_table.py \
232 $src_dir/src/util/format/u_format.csv \
233 >$build_dir/src/util/u_format_table.c
235 # wow, really?
236 $python3 $src_dir/src/util/format/u_format_table.py \
237 --header \
238 $src_dir/src/util/format/u_format.csv \
239 >$build_dir/src/util/format/u_format_pack.h
241 # oooof!
242 $python3 $src_dir/src/util/driconf_static.py \
243 $src_dir/src/util/00-mesa-defaults.conf \
244 $build_dir/src/util/driconf_static.h
245 unset PYTHONPATH
246 #$src_dir/src/util/bitset_test.cpp wtf? rotten brain?
247 #===============================================================================
248 # amd vulkan
249 export PYTHONPATH=$mako
250 #------------------------------------------------------------------------------
251 # specific API to work around _still maintained at the time of writing _ game
252 # executable... this is the beginning of the end...
253 $python3 $src_dir/src/vulkan/util/vk_entrypoints_gen.py \
254 --beta false \
255 --xml $vulkan_api_xml \
256 --proto --weak \
257 --out-h $build_dir/src/amd/vulkan/radv_entrypoints.h \
258 --out-c $build_dir/src/amd/vulkan/radv_entrypoints.c \
259 --prefix radv \
260 --device-prefix metro_exodus \
261 --device-prefix quantic_dream \
262 --device-prefix rage2 &
263 #------------------------------------------------------------------------------
264 #$python3 $src_dir/src/amd/vulkan/radv_extensions.py \
265 # --xml $vulkan_api_xml \
266 # --out-c radv_extensions.c \
267 # --out-h radv_extensions.h &
268 #------------------------------------------------------------------------------
269 #$python3 $src_dir/src/amd/vulkan/vk_format_table.py \
270 # $src_dir/src/amd/vulkan/vk_format_layout.csv \
271 # >$build_dir/vk_format_table.c &
272 #------------------------------------------------------------------------------
273 $python3 $src_dir/src/amd/common/gfx10_format_table.py \
274 $src_dir/src/util/format/u_format.csv \
275 $src_dir/src/amd/registers/gfx10-rsrc.json \
276 $src_dir/src/amd/registers/gfx11-rsrc.json \
277 $src_dir/src/amd/registers/gfx12-rsrc.json \
278 >$build_dir/src/amd/common/gfx10_format_table.c &
279 #------------------------------------------------------------------------------
280 git_sha1=no_git_sha1_available
281 if test -d $src_dir/.git; then
282 git_sha1=$(git --git-dir=$src_dir/.git rev-parse HEAD)
284 echo git_sha1=$git_sha1
285 echo "#define MESA_GIT_SHA1 \"$git_sha1\"" >$build_dir/src/git_sha1.h &
286 unset PYTHONPATH
287 #===============================================================================