1 # Copyright © 2017 Rob Clark
3 # Permission is hereby granted, free of charge, to any person obtaining a copy
4 # of this software and associated documentation files (the "Software"), to deal
5 # in the Software without restriction, including without limitation the rights
6 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 # copies of the Software, and to permit persons to whom the Software is
8 # furnished to do so, subject to the following conditions:
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 ir3_nir_trig_c = custom_target(
23 input : 'ir3/ir3_nir_trig.py',
24 output : 'ir3_nir_trig.c',
25 command : [prog_python2, '@INPUT@', '-p',
26 join_paths(meson.source_root(), 'src/compiler/nir/')],
28 depend_files : nir_algebraic_py,
31 files_libfreedreno = files(
32 'adreno_common.xml.h',
37 'freedreno_batch_cache.c',
38 'freedreno_batch_cache.h',
39 'freedreno_blitter.c',
40 'freedreno_blitter.h',
41 'freedreno_context.c',
42 'freedreno_context.h',
49 'freedreno_program.c',
50 'freedreno_program.h',
53 'freedreno_query_acc.c',
54 'freedreno_query_acc.h',
55 'freedreno_query_hw.c',
56 'freedreno_query_hw.h',
57 'freedreno_query_sw.c',
58 'freedreno_query_sw.h',
59 'freedreno_resource.c',
60 'freedreno_resource.h',
65 'freedreno_surface.c',
66 'freedreno_surface.h',
67 'freedreno_texture.c',
68 'freedreno_texture.h',
75 'a2xx/fd2_compiler.c',
76 'a2xx/fd2_compiler.h',
87 'a2xx/fd2_rasterizer.c',
88 'a2xx/fd2_rasterizer.h',
103 'a3xx/fd3_context.c',
104 'a3xx/fd3_context.h',
113 'a3xx/fd3_program.c',
114 'a3xx/fd3_program.h',
117 'a3xx/fd3_rasterizer.c',
118 'a3xx/fd3_rasterizer.h',
121 'a3xx/fd3_texture.c',
122 'a3xx/fd3_texture.h',
128 'a4xx/fd4_context.c',
129 'a4xx/fd4_context.h',
138 'a4xx/fd4_program.c',
139 'a4xx/fd4_program.h',
142 'a4xx/fd4_rasterizer.c',
143 'a4xx/fd4_rasterizer.h',
146 'a4xx/fd4_texture.c',
147 'a4xx/fd4_texture.h',
153 'a5xx/fd5_blitter.c',
154 'a5xx/fd5_blitter.h',
155 'a5xx/fd5_compute.c',
156 'a5xx/fd5_compute.h',
157 'a5xx/fd5_context.c',
158 'a5xx/fd5_context.h',
169 'a5xx/fd5_program.c',
170 'a5xx/fd5_program.h',
173 'a5xx/fd5_rasterizer.c',
174 'a5xx/fd5_rasterizer.h',
177 'a5xx/fd5_texture.c',
178 'a5xx/fd5_texture.h',
184 'ir3/ir3_compiler_nir.c',
185 'ir3/ir3_compiler.c',
186 'ir3/ir3_compiler.h',
191 'ir3/ir3_legalize.c',
194 'ir3/ir3_nir_lower_if_else.c',
195 'ir3/ir3_nir_lower_tg4_to_tex.c',
203 freedreno_includes = [
204 inc_src, inc_include, inc_gallium, inc_gallium_aux, inc_nir,
205 include_directories('ir3')
208 freedreno_c_args = []
209 if cc.has_argument('-Wpacked-bitfield-compat')
210 freedreno_c_args += '-Wno-packed-bitfield-compat'
213 freedreno_cpp_args = []
214 if cpp.has_argument('-Wpacked-bitfield-compat')
215 freedreno_cpp_args += '-Wno-packed-bitfield-compat'
218 libfreedreno = static_library(
220 [files_libfreedreno, ir3_nir_trig_c, nir_opcodes_h],
221 include_directories : freedreno_includes,
222 c_args : [freedreno_c_args, c_vis_args],
223 cpp_args : [freedreno_cpp_args, cpp_vis_args],
224 dependencies : [dep_libdrm, dep_libdrm_freedreno],
227 driver_freedreno = declare_dependency(
228 compile_args : '-DGALLIUM_FREEDRENO',
229 link_with : [libfreedrenowinsys, libfreedreno],
232 ir3_compiler = executable(
235 include_directories : freedreno_includes,
238 dep_libdrm_freedreno,
249 build_by_default : true,