gfx stack update (still holding the breaking llvm)
[nyanlinux.git] / builders / mesa-gl-amd-sh-81d85be9a5cfb5860ba5d15f2bf6f1a4946e411e / contrib / gallium_drivers.sh
blob075eedfc10dc1a8d104bc3a8acc74ad2d646b6b3
1 printf "\tbuilding drivers sub-components-->\n"
2 mkdir -p $build_dir/src/gallium/drivers/radeonsi
4 export PYTHONPATH=$mako
5 $python3 $src_dir/src/amd/common/gfx10_format_table.py \
6 $src_dir/src/util/format/u_format.csv \
7 $src_dir/src/amd/registers/gfx10-rsrc.json \
8 $src_dir/src/amd/registers/gfx11-rsrc.json \
9 >$build_dir/src/gallium/drivers/radeonsi/gfx10_format_table.c
10 unset PYTHONPATH
12 #-------------------------------------------------------------------------------
14 # do remove the radeonsi pipe loader fallback from (amdgpu/drm winsys) to
15 # (radeon/drm winsys)
16 mkdir -p $build_dir/src/gallium/drivers/radeonsi
17 cp -f $src_dir/src/gallium/drivers/radeonsi/si_pipe.c $build_dir/src/gallium/drivers/radeonsi/
18 patch -i $script_dir/si_pipe.c.patch $build_dir/src/gallium/drivers/radeonsi/si_pipe.c
20 # uvd block is crap, avoid any non-critical code related to it
21 cp -f $script_dir/si_uvd.c $build_dir/src/gallium/drivers/radeonsi/si_uvd.c
23 libradeonsi_files_c="\
24 $build_dir/src/gallium/drivers/radeonsi/gfx10_format_table.c \
25 $src_dir/src/gallium/drivers/radeonsi/gfx10_query.c \
26 $src_dir/src/gallium/drivers/radeonsi/gfx10_shader_ngg.c \
28 $src_dir/src/gallium/drivers/radeonsi/si_blit.c \
29 $src_dir/src/gallium/drivers/radeonsi/si_buffer.c \
30 $src_dir/src/gallium/drivers/radeonsi/si_clear.c \
31 $src_dir/src/gallium/drivers/radeonsi/si_compute.c \
32 $src_dir/src/gallium/drivers/radeonsi/si_compute_blit.c \
33 $src_dir/src/gallium/drivers/radeonsi/si_cp_dma.c \
34 $src_dir/src/gallium/drivers/radeonsi/si_cp_reg_shadowing.c \
35 $src_dir/src/gallium/drivers/radeonsi/si_debug.c \
36 $src_dir/src/gallium/drivers/radeonsi/si_descriptors.c \
37 $src_dir/src/gallium/drivers/radeonsi/si_sdma_copy_image.c \
38 $src_dir/src/gallium/drivers/radeonsi/si_fence.c \
39 $src_dir/src/gallium/drivers/radeonsi/si_get.c \
40 $src_dir/src/gallium/drivers/radeonsi/si_gfx_cs.c \
41 $src_dir/src/gallium/drivers/radeonsi/si_gpu_load.c \
42 $src_dir/src/gallium/drivers/radeonsi/si_nir_optim.c \
43 $src_dir/src/gallium/drivers/radeonsi/si_perfcounter.c \
44 $build_dir/src/gallium/drivers/radeonsi/si_pipe.c \
45 $src_dir/src/gallium/drivers/radeonsi/si_pm4.c \
46 $src_dir/src/gallium/drivers/radeonsi/si_query.c \
47 $src_dir/src/gallium/drivers/radeonsi/si_shader.c \
48 $src_dir/src/gallium/drivers/radeonsi/si_shader_info.c \
49 $src_dir/src/gallium/drivers/radeonsi/si_shaderlib_nir.c \
50 $src_dir/src/gallium/drivers/radeonsi/si_shader_llvm.c \
51 $src_dir/src/gallium/drivers/radeonsi/si_shader_llvm_vs.c \
52 $src_dir/src/gallium/drivers/radeonsi/si_shader_llvm_gs.c \
53 $src_dir/src/gallium/drivers/radeonsi/si_shader_llvm_ps.c \
54 $src_dir/src/gallium/drivers/radeonsi/si_shader_llvm_resources.c \
55 $src_dir/src/gallium/drivers/radeonsi/si_shader_llvm_tess.c \
56 $src_dir/src/gallium/drivers/radeonsi/si_shader_nir.c \
57 $src_dir/src/gallium/drivers/radeonsi/si_shaderlib_tgsi.c \
58 $src_dir/src/gallium/drivers/radeonsi/si_sqtt.c \
59 $src_dir/src/gallium/drivers/radeonsi/si_state.c \
60 $src_dir/src/gallium/drivers/radeonsi/si_state_binning.c \
61 $src_dir/src/gallium/drivers/radeonsi/si_state_msaa.c \
62 $src_dir/src/gallium/drivers/radeonsi/si_state_streamout.c \
63 $src_dir/src/gallium/drivers/radeonsi/si_state_viewport.c \
64 $src_dir/src/gallium/drivers/radeonsi/si_test_dma_perf.c \
65 $src_dir/src/gallium/drivers/radeonsi/si_test_image_copy_region.c \
66 $src_dir/src/gallium/drivers/radeonsi/si_texture.c \
67 $build_dir/src/gallium/drivers/radeonsi/si_uvd.c \
69 $src_dir/src/gallium/drivers/radeonsi/radeon_uvd.c \
70 $src_dir/src/gallium/drivers/radeonsi/radeon_vcn.c \
71 $src_dir/src/gallium/drivers/radeonsi/radeon_vcn_enc_1_2.c \
72 $src_dir/src/gallium/drivers/radeonsi/radeon_vcn_enc_2_0.c \
73 $src_dir/src/gallium/drivers/radeonsi/radeon_vcn_enc_3_0.c \
74 $src_dir/src/gallium/drivers/radeonsi/radeon_vcn_enc_4_0.c \
75 $src_dir/src/gallium/drivers/radeonsi/radeon_vcn_enc.c \
76 $src_dir/src/gallium/drivers/radeonsi/radeon_vcn_dec_jpeg.c \
77 $src_dir/src/gallium/drivers/radeonsi/radeon_vcn_dec.c \
78 $src_dir/src/gallium/drivers/radeonsi/radeon_uvd_enc_1_1.c \
79 $src_dir/src/gallium/drivers/radeonsi/radeon_uvd_enc.c \
80 $src_dir/src/gallium/drivers/radeonsi/radeon_vce_40_2_2.c \
81 $src_dir/src/gallium/drivers/radeonsi/radeon_vce_50.c \
82 $src_dir/src/gallium/drivers/radeonsi/radeon_vce_52.c \
83 $src_dir/src/gallium/drivers/radeonsi/radeon_vce.c \
84 $src_dir/src/gallium/drivers/radeonsi/radeon_video.c \
86 #-------------------------------------------------------------------------------
88 for f in $libradeonsi_files_c
90 libradeonsi_obj_dir=$(dirname $f)
91 libradeonsi_obj_dir=$build_dir/${libradeonsi_obj_dir#*/src/}
92 mkdir -p $libradeonsi_obj_dir
94 libradeonsi_obj=$libradeonsi_obj_dir/$(basename $f .c).o
95 libradeonsi_a="$libradeonsi_a $libradeonsi_obj"
97 $cco_slib -o $libradeonsi_obj $f \
98 -I$build_dir/src/gallium/drivers/radeonsi \
99 -I$build_dir/src/amd \
100 -I$build_dir/src/compiler/nir \
101 -I$src_dir/src/util \
102 -I$src_dir/src/amd/llvm \
103 -I$src_dir/src/amd/common \
104 -I$src_dir/src/amd \
105 -I$src_dir/src/gallium/drivers/radeonsi \
106 -I$src_dir/src/gallium/drivers \
107 -I$src_dir/src/gallium/auxiliary \
108 -I$src_dir/src/gallium/include \
109 -I$src_dir/src/compiler/nir \
110 -I$src_dir/src \
111 -I$src_dir/include \
112 $cco_slib_common_trailer &
113 done
115 # don't mind cpp here, GL is massive cr*p like c++ anyway
116 libradeonsi_files_cpp="\
117 $src_dir/src/gallium/drivers/radeonsi/si_state_shaders.cpp \
120 for f in $libradeonsi_files_cpp
122 libradeonsi_obj_dir=$(dirname $f)
123 libradeonsi_obj_dir=$build_dir/${libradeonsi_obj_dir#*/src/}
124 mkdir -p $libradeonsi_obj_dir
126 libradeonsi_obj=$libradeonsi_obj_dir/$(basename $f .cpp).o
127 libradeonsi_a="$libradeonsi_a $libradeonsi_obj"
129 $cxxo_slib -o $libradeonsi_obj $f \
130 -I$build_dir/src/gallium/drivers/radeonsi \
131 -I$build_dir/src/amd \
132 -I$build_dir/src/compiler/nir \
133 -I$src_dir/src/util \
134 -I$src_dir/src/amd/llvm \
135 -I$src_dir/src/amd/common \
136 -I$src_dir/src/amd \
137 -I$src_dir/src/gallium/drivers/radeonsi \
138 -I$src_dir/src/gallium/drivers \
139 -I$src_dir/src/gallium/auxiliary \
140 -I$src_dir/src/gallium/include \
141 -I$src_dir/src/compiler/nir \
142 -I$src_dir/src \
143 -I$src_dir/include \
144 $cco_slib_common_trailer &
145 done
147 wait
148 $ar $build_dir/libradeonsi.a $libradeonsi_a
150 libradeonsi_gfx_files_cpp="\
151 $src_dir/src/gallium/drivers/radeonsi/si_state_draw.cpp \
153 for g in 6 7 8 9 10 103 11
155 libradeonsi_gfx_a=
156 for f in $libradeonsi_gfx_files_cpp
158 libradeonsi_gfx_obj_dir=$(dirname $f)
159 libradeonsi_gfx_obj_dir=$build_dir/${libradeonsi_gfx_obj_dir#*/src/}
160 mkdir -p $libradeonsi_gfx_obj_dir
162 libradeonsi_gfx_obj=$libradeonsi_gfx_obj_dir/$(basename $f .c).$g.o
163 libradeonsi_gfx_a="$libradeonsi_gfx_a $libradeonsi_gfx_obj"
165 $cxxo_slib -o $libradeonsi_gfx_obj $f \
166 -DGFX_VER=$g \
167 -I$build_dir/src/gallium/drivers/radeonsi \
168 -I$build_dir/src/amd \
169 -I$build_dir/src/compiler/nir \
170 -I$src_dir/src/util \
171 -I$src_dir/src/amd/llvm \
172 -I$src_dir/src/amd/common \
173 -I$src_dir/src/amd \
174 -I$src_dir/src/gallium/drivers/radeonsi \
175 -I$src_dir/src/gallium/drivers \
176 -I$src_dir/src/gallium/auxiliary \
177 -I$src_dir/src/gallium/include \
178 -I$src_dir/src/compiler/nir \
179 -I$src_dir/src \
180 -I$src_dir/include \
181 $cco_slib_common_trailer &
182 done
183 wait
184 $ar $build_dir/libradeonsi_gfx$g.a $libradeonsi_gfx_a
185 libradeonsi_gfx_libs="$libradeonsi_gfx_libs $build_dir/libradeonsi_gfx$g.a"
186 done
187 printf "\t<--drivers sub-components built\n"