mesa-gl:moved to "simplified /usr" and towards RCS
[nyanlinux.git] / builders / mesa-vulkan-amd-sh-3b05ebaa625428ac3590a7ba1848a6234a572db4 / contrib / generators.sh
blobcf531ae2a1ae8f5d50f9add93e5adcd8da2e79e8
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 runtime
65 export PYTHONPATH=$mako
66 $python3 $src_dir/src/vulkan/util/vk_entrypoints_gen.py \
67 --beta false \
68 --xml $vulkan_api_xml \
69 --proto --weak \
70 --out-h $build_dir/src/vulkan/runtime/vk_common_entrypoints.h \
71 --out-c $build_dir/src/vulkan/runtime/vk_common_entrypoints.c \
72 --prefix vk_common &
73 $python3 $src_dir/src/vulkan/util/vk_entrypoints_gen.py \
74 --beta false \
75 --xml $vulkan_api_xml \
76 --proto --weak \
77 --out-h $build_dir/src/vulkan/runtime/vk_cmd_enqueue_entrypoints.h \
78 --out-c $build_dir/src/vulkan/runtime/vk_cmd_enqueue_entrypoints.c \
79 --prefix vk_cmd_enqueue &
80 $python3 $src_dir/src/vulkan/util/vk_cmd_queue_gen.py \
81 --beta false \
82 --xml $vulkan_api_xml \
83 --out-h $build_dir/src/vulkan/runtime/vk_cmd_queue.h \
84 --out-c $build_dir/src/vulkan/runtime/vk_cmd_queue.c &
85 $python3 $src_dir/src/vulkan/util/vk_dispatch_trampolines_gen.py \
86 --beta false \
87 --xml $vulkan_api_xml \
88 --out-h $build_dir/src/vulkan/runtime/vk_dispatch_trampolines.h \
89 --out-c $build_dir/src/vulkan/runtime/vk_dispatch_trampolines.c &
90 $python3 $src_dir/src/vulkan/util/vk_physical_device_features_gen.py \
91 --beta false \
92 --xml $vulkan_api_xml \
93 --out-h $build_dir/src/vulkan/runtime/vk_physical_device_features.h \
94 --out-c $build_dir/src/vulkan/runtime/vk_physical_device_features.c &
95 $python3 $src_dir/src/vulkan/util/vk_physical_device_properties_gen.py \
96 --beta false \
97 --xml $vulkan_api_xml \
98 --out-h $build_dir/src/vulkan/runtime/vk_physical_device_properties.h \
99 --out-c $build_dir/src/vulkan/runtime/vk_physical_device_properties.c &
100 $python3 $src_dir/src/vulkan/runtime/vk_format_info_gen.py \
101 --xml $vulkan_api_xml \
102 --out-h $build_dir/src/vulkan/runtime/vk_format_info.h \
103 --out-c $build_dir/src/vulkan/runtime/vk_format_info.c &
104 $python3 $src_dir/src/vulkan/util/vk_synchronization_helpers_gen.py \
105 --beta false \
106 --xml $vulkan_api_xml \
107 --out-c $build_dir/src/vulkan/runtime/vk_synchronization_helpers.c &
108 unset PYTHONPATH
109 #===============================================================================
110 # wsi x11 (Window System Interface)
111 export PYTHONPATH=$mako
112 $python3 $src_dir/src/vulkan/util/vk_entrypoints_gen.py \
113 --beta false \
114 --xml $vulkan_api_xml \
115 --proto --weak \
116 --out-h $build_dir/src/vulkan/wsi/wsi_common_entrypoints.h \
117 --out-c $build_dir/src/vulkan/wsi/wsi_common_entrypoints.c \
118 --prefix wsi &
119 unset PYTHONPATH
120 #===============================================================================
121 # amd common archive
122 $python3 $src_dir/src/amd/common/sid_tables.py \
123 $src_dir/src/amd/common/sid.h \
124 $src_dir/src/amd/registers/gfx6.json \
125 $src_dir/src/amd/registers/gfx7.json \
126 $src_dir/src/amd/registers/gfx8.json \
127 $src_dir/src/amd/registers/gfx81.json \
128 $src_dir/src/amd/registers/gfx9.json \
129 $src_dir/src/amd/registers/gfx940.json \
130 $src_dir/src/amd/registers/gfx10.json \
131 $src_dir/src/amd/registers/gfx10-rsrc.json \
132 $src_dir/src/amd/registers/gfx103.json \
133 $src_dir/src/amd/registers/gfx11.json \
134 $src_dir/src/amd/registers/gfx115.json \
135 $src_dir/src/amd/registers/gfx11-rsrc.json \
136 $src_dir/src/amd/registers/pkt3.json \
137 $src_dir/src/amd/registers/registers-manually-defined.json \
138 >$build_dir/src/amd/common/sid_tables.h &
139 $python3 $src_dir/src/amd/registers/makeregheader.py \
140 $src_dir/src/amd/registers/gfx6.json \
141 $src_dir/src/amd/registers/gfx7.json \
142 $src_dir/src/amd/registers/gfx8.json \
143 $src_dir/src/amd/registers/gfx81.json \
144 $src_dir/src/amd/registers/gfx9.json \
145 $src_dir/src/amd/registers/gfx940.json \
146 $src_dir/src/amd/registers/gfx10.json \
147 $src_dir/src/amd/registers/gfx10-rsrc.json \
148 $src_dir/src/amd/registers/gfx11.json \
149 $src_dir/src/amd/registers/gfx115.json \
150 $src_dir/src/amd/registers/gfx11-rsrc.json \
151 $src_dir/src/amd/registers/gfx103.json \
152 $src_dir/src/amd/registers/pkt3.json \
153 $src_dir/src/amd/registers/registers-manually-defined.json \
154 --sort address \
155 --guard AMDGFXREGS_H \
156 >$build_dir/src/amd/common/amdgfxregs.h &
157 #===============================================================================
158 # libcompiler required by libnir
159 export PYTHONPATH=$mako
160 #------------------------------------------------------------------------------
161 $python3 $src_dir/src/compiler/glsl/ir_expression_operation.py enum \
162 >$build_dir/src/compiler/glsl/ir_expression_operation.h &
163 #------------------------------------------------------------------------------
164 $python3 $src_dir/src/compiler/builtin_types_h.py \
165 $build_dir/src/compiler/builtin_types.h &
166 #------------------------------------------------------------------------------
167 $python3 $src_dir/src/compiler/builtin_types_c.py \
168 $build_dir/src/compiler/builtin_types.c &
169 #------------------------------------------------------------------------------
170 unset PYTHONPATH
171 #===============================================================================
172 # libnir
173 export PYTHONPATH=$mako
174 $python3 $src_dir/src/compiler/spirv/spirv_info_c.py \
175 $src_dir/src/compiler/spirv/spirv.core.grammar.json \
176 $build_dir/src/compiler/spirv/spirv_info.c &
178 $python3 $src_dir/src/compiler/spirv/vtn_gather_types_c.py \
179 $src_dir/src/compiler/spirv/spirv.core.grammar.json \
180 $build_dir/src/compiler/spirv/vtn_gather_types.c &
182 $python3 $src_dir/src/compiler/spirv/vtn_generator_ids_h.py \
183 $src_dir/src/compiler/spirv/spir-v.xml \
184 $build_dir/src/compiler/spirv/vtn_generator_ids.h &
185 # nir generated files
186 $python3 $src_dir/src/compiler/nir/nir_constant_expressions.py \
187 >$build_dir/src/compiler/nir/nir_constant_expressions.c &
189 $python3 $src_dir/src/compiler/nir/nir_opt_algebraic.py \
190 >$build_dir/src/compiler/nir/nir_opt_algebraic.c &
192 $python3 $src_dir/src/compiler/nir/nir_opcodes_c.py \
193 >$build_dir/src/compiler/nir/nir_opcodes.c &
195 $python3 $src_dir/src/compiler/nir/nir_intrinsics_c.py \
196 --outdir $build_dir/src/compiler/nir &
197 unset PYTHONPATH
198 #===============================================================================
199 # libaco
200 export PYTHONPATH=$mako
201 $python3 $src_dir/src/amd/compiler/aco_opcodes_h.py \
202 >$build_dir/src/amd/compiler/aco_opcodes.h &
203 $python3 $src_dir/src/amd/compiler/aco_opcodes_cpp.py \
204 >$build_dir/src/amd/compiler/aco_opcodes.cpp &
205 $python3 $src_dir/src/amd/compiler/aco_builder_h.py \
206 >$build_dir/src/amd/compiler/aco_builder.h &
207 unset PYTHONPATH
208 #===============================================================================
209 # libmesautils
210 export PYTHONPATH=$mako
211 $python3 $src_dir/src/util/format_srgb.py \
212 >$build_dir/src/util/format_srgb.c
214 $python3 $src_dir/src/util/format/u_format_table.py \
215 $src_dir/src/util/format/u_format.csv \
216 >$build_dir/src/util/u_format_table.c
218 # wow, really?
219 $python3 $src_dir/src/util/format/u_format_table.py \
220 --header \
221 $src_dir/src/util/format/u_format.csv \
222 >$build_dir/src/util/format/u_format_pack.h
224 # oooof!
225 $python3 $src_dir/src/util/driconf_static.py \
226 $src_dir/src/util/00-mesa-defaults.conf \
227 $build_dir/src/util/driconf_static.h
228 unset PYTHONPATH
229 #$src_dir/src/util/bitset_test.cpp wtf? rotten brain?
230 #===============================================================================
231 # amd vulkan
232 export PYTHONPATH=$mako
233 #------------------------------------------------------------------------------
234 # specific API to work around _still maintained at the time of writing _ game
235 # executable... this is the beginning of the end...
236 $python3 $src_dir/src/vulkan/util/vk_entrypoints_gen.py \
237 --beta false \
238 --xml $vulkan_api_xml \
239 --proto --weak \
240 --out-h $build_dir/src/amd/vulkan/radv_entrypoints.h \
241 --out-c $build_dir/src/amd/vulkan/radv_entrypoints.c \
242 --prefix radv \
243 --device-prefix metro_exodus \
244 --device-prefix quantic_dream \
245 --device-prefix rage2 &
246 #------------------------------------------------------------------------------
247 #$python3 $src_dir/src/amd/vulkan/radv_extensions.py \
248 # --xml $vulkan_api_xml \
249 # --out-c radv_extensions.c \
250 # --out-h radv_extensions.h &
251 #------------------------------------------------------------------------------
252 #$python3 $src_dir/src/amd/vulkan/vk_format_table.py \
253 # $src_dir/src/amd/vulkan/vk_format_layout.csv \
254 # >$build_dir/vk_format_table.c &
255 #------------------------------------------------------------------------------
256 $python3 $src_dir/src/amd/common/gfx10_format_table.py \
257 $src_dir/src/util/format/u_format.csv \
258 $src_dir/src/amd/registers/gfx10-rsrc.json \
259 $src_dir/src/amd/registers/gfx11-rsrc.json \
260 >$build_dir/src/amd/common/gfx10_format_table.c &
261 #------------------------------------------------------------------------------
262 git_sha1=no_git_sha1_available
263 if test -d $src_dir/.git; then
264 git_sha1=$(git --git-dir=$src_dir/.git rev-parse HEAD)
266 echo git_sha1=$git_sha1
267 echo "#define MESA_GIT_SHA1 \"$git_sha1\"" >$build_dir/src/git_sha1.h &
268 unset PYTHONPATH
269 #===============================================================================