1# Copyright © 2017 Dylan Baker
2
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:
9
10# The above copyright notice and this permission notice shall be included in
11# all copies or substantial portions of the Software.
12
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
19# SOFTWARE.
20
21files_libgallium = files(
22  'cso_cache/cso_cache.c',
23  'cso_cache/cso_cache.h',
24  'cso_cache/cso_context.c',
25  'cso_cache/cso_context.h',
26  'cso_cache/cso_hash.c',
27  'cso_cache/cso_hash.h',
28  'draw/draw_cliptest_tmp.h',
29  'draw/draw_context.c',
30  'draw/draw_context.h',
31  'draw/draw_decompose_tmp.h',
32  'draw/draw_fs.c',
33  'draw/draw_fs.h',
34  'draw/draw_gs.c',
35  'draw/draw_gs.h',
36  'draw/draw_gs_tmp.h',
37  'draw/draw_pipe_aaline.c',
38  'draw/draw_pipe_aapoint.c',
39  'draw/draw_pipe.c',
40  'draw/draw_pipe.h',
41  'draw/draw_pipe_clip.c',
42  'draw/draw_pipe_cull.c',
43  'draw/draw_pipe_flatshade.c',
44  'draw/draw_pipe_offset.c',
45  'draw/draw_pipe_pstipple.c',
46  'draw/draw_pipe_stipple.c',
47  'draw/draw_pipe_twoside.c',
48  'draw/draw_pipe_unfilled.c',
49  'draw/draw_pipe_user_cull.c',
50  'draw/draw_pipe_util.c',
51  'draw/draw_pipe_validate.c',
52  'draw/draw_pipe_vbuf.c',
53  'draw/draw_pipe_wide_line.c',
54  'draw/draw_pipe_wide_point.c',
55  'draw/draw_prim_assembler.c',
56  'draw/draw_prim_assembler.h',
57  'draw/draw_prim_assembler_tmp.h',
58  'draw/draw_private.h',
59  'draw/draw_pt.c',
60  'draw/draw_pt_decompose.h',
61  'draw/draw_pt_emit.c',
62  'draw/draw_pt_fetch.c',
63  'draw/draw_pt_fetch_shade_emit.c',
64  'draw/draw_pt_fetch_shade_pipeline.c',
65  'draw/draw_pt.h',
66  'draw/draw_pt_post_vs.c',
67  'draw/draw_pt_so_emit.c',
68  'draw/draw_pt_util.c',
69  'draw/draw_pt_vsplit.c',
70  'draw/draw_pt_vsplit_tmp.h',
71  'draw/draw_so_emit_tmp.h',
72  'draw/draw_split_tmp.h',
73  'draw/draw_tess.c',
74  'draw/draw_tess.h',
75  'draw/draw_vbuf.h',
76  'draw/draw_vertex.c',
77  'draw/draw_vertex.h',
78  'draw/draw_vs.c',
79  'draw/draw_vs_exec.c',
80  'draw/draw_vs.h',
81  'draw/draw_vs_variant.c',
82  'driver_ddebug/dd_context.c',
83  'driver_ddebug/dd_draw.c',
84  'driver_ddebug/dd_pipe.h',
85  'driver_ddebug/dd_public.h',
86  'driver_ddebug/dd_screen.c',
87  'driver_ddebug/dd_util.h',
88  'driver_noop/noop_pipe.c',
89  'driver_noop/noop_public.h',
90  'driver_noop/noop_state.c',
91  'driver_rbug/rbug_context.c',
92  'driver_rbug/rbug_context.h',
93  'driver_rbug/rbug_core.c',
94  'driver_rbug/rbug_objects.c',
95  'driver_rbug/rbug_objects.h',
96  'driver_rbug/rbug_public.h',
97  'driver_rbug/rbug_screen.c',
98  'driver_rbug/rbug_screen.h',
99  'driver_trace/tr_context.c',
100  'driver_trace/tr_context.h',
101  'driver_trace/tr_dump.c',
102  'driver_trace/tr_dump_defines.h',
103  'driver_trace/tr_dump.h',
104  'driver_trace/tr_dump_state.c',
105  'driver_trace/tr_dump_state.h',
106  'driver_trace/tr_public.h',
107  'driver_trace/tr_screen.c',
108  'driver_trace/tr_screen.h',
109  'driver_trace/tr_texture.c',
110  'driver_trace/tr_texture.h',
111  'hud/font.c',
112  'hud/font.h',
113  'hud/hud_context.c',
114  'hud/hud_context.h',
115  'hud/hud_cpu.c',
116  'hud/hud_nic.c',
117  'hud/hud_cpufreq.c',
118  'hud/hud_diskstat.c',
119  'hud/hud_sensors_temp.c',
120  'hud/hud_driver_query.c',
121  'hud/hud_fps.c',
122  'hud/hud_private.h',
123  'indices/u_indices.h',
124  'indices/u_indices_priv.h',
125  'indices/u_primconvert.c',
126  'indices/u_primconvert.h',
127  'os/os_mman.h',
128  'os/os_process.c',
129  'os/os_process.h',
130  'os/os_thread.h',
131  'pipebuffer/pb_buffer_fenced.c',
132  'pipebuffer/pb_buffer_fenced.h',
133  'pipebuffer/pb_buffer.h',
134  'pipebuffer/pb_bufmgr_cache.c',
135  'pipebuffer/pb_bufmgr_debug.c',
136  'pipebuffer/pb_bufmgr.h',
137  'pipebuffer/pb_bufmgr_mm.c',
138  'pipebuffer/pb_bufmgr_slab.c',
139  'pipebuffer/pb_cache.c',
140  'pipebuffer/pb_cache.h',
141  'pipebuffer/pb_slab.c',
142  'pipebuffer/pb_slab.h',
143  'pipebuffer/pb_validate.c',
144  'pipebuffer/pb_validate.h',
145  'postprocess/filters.h',
146  'postprocess/postprocess.h',
147  'postprocess/pp_celshade.c',
148  'postprocess/pp_celshade.h',
149  'postprocess/pp_colors.c',
150  'postprocess/pp_colors.h',
151  'postprocess/pp_filters.h',
152  'postprocess/pp_init.c',
153  'postprocess/pp_mlaa_areamap.h',
154  'postprocess/pp_mlaa.c',
155  'postprocess/pp_mlaa.h',
156  'postprocess/pp_private.h',
157  'postprocess/pp_program.c',
158  'postprocess/pp_run.c',
159  'rbug/rbug_connection.c',
160  'rbug/rbug_connection.h',
161  'rbug/rbug_context.c',
162  'rbug/rbug_context.h',
163  'rbug/rbug_core.c',
164  'rbug/rbug_core.h',
165  'rbug/rbug_demarshal.c',
166  'rbug/rbug.h',
167  'rbug/rbug_internal.h',
168  'rbug/rbug_proto.h',
169  'rbug/rbug_shader.c',
170  'rbug/rbug_shader.h',
171  'rbug/rbug_texture.c',
172  'rbug/rbug_texture.h',
173  'rtasm/rtasm_cpu.c',
174  'rtasm/rtasm_cpu.h',
175  'rtasm/rtasm_execmem.c',
176  'rtasm/rtasm_execmem.h',
177  'rtasm/rtasm_x86sse.c',
178  'rtasm/rtasm_x86sse.h',
179  'tgsi/tgsi_aa_point.c',
180  'tgsi/tgsi_aa_point.h',
181  'tgsi/tgsi_build.c',
182  'tgsi/tgsi_build.h',
183  'tgsi/tgsi_dump.c',
184  'tgsi/tgsi_dump.h',
185  'tgsi/tgsi_dynamic_indexing.c',
186  'tgsi/tgsi_exec.c',
187  'tgsi/tgsi_exec.h',
188  'tgsi/tgsi_emulate.c',
189  'tgsi/tgsi_emulate.h',
190  'tgsi/tgsi_from_mesa.c',
191  'tgsi/tgsi_from_mesa.h',
192  'tgsi/tgsi_info.c',
193  'tgsi/tgsi_info.h',
194  'tgsi/tgsi_info_opcodes.h',
195  'tgsi/tgsi_iterate.c',
196  'tgsi/tgsi_iterate.h',
197  'tgsi/tgsi_lowering.c',
198  'tgsi/tgsi_lowering.h',
199  'tgsi/tgsi_opcode_tmp.h',
200  'tgsi/tgsi_parse.c',
201  'tgsi/tgsi_parse.h',
202  'tgsi/tgsi_point_sprite.c',
203  'tgsi/tgsi_point_sprite.h',
204  'tgsi/tgsi_sanity.c',
205  'tgsi/tgsi_sanity.h',
206  'tgsi/tgsi_scan.c',
207  'tgsi/tgsi_scan.h',
208  'tgsi/tgsi_strings.c',
209  'tgsi/tgsi_strings.h',
210  'tgsi/tgsi_text.c',
211  'tgsi/tgsi_text.h',
212  'tgsi/tgsi_transform.c',
213  'tgsi/tgsi_transform.h',
214  'tgsi/tgsi_two_side.c',
215  'tgsi/tgsi_two_side.h',
216  'tgsi/tgsi_ureg.c',
217  'tgsi/tgsi_ureg.h',
218  'tgsi/tgsi_util.c',
219  'tgsi/tgsi_util.h',
220  'tgsi/tgsi_vpos.c',
221  'translate/translate.c',
222  'translate/translate.h',
223  'translate/translate_cache.c',
224  'translate/translate_cache.h',
225  'translate/translate_generic.c',
226  'translate/translate_sse.c',
227  'util/dbghelp.h',
228  'util/u_async_debug.h',
229  'util/u_async_debug.c',
230  'util/u_bitcast.h',
231  'util/u_bitmask.c',
232  'util/u_bitmask.h',
233  'util/u_blend.h',
234  'util/u_blitter.c',
235  'util/u_blitter.h',
236  'util/u_box.h',
237  'util/u_cache.c',
238  'util/u_cache.h',
239  'util/u_compute.c',
240  'util/u_compute.h',
241  'util/u_debug_flush.c',
242  'util/u_debug_flush.h',
243  'util/u_debug_image.c',
244  'util/u_debug_image.h',
245  'util/u_dirty_flags.h',
246  'util/u_dirty_surfaces.h',
247  'util/u_dl.c',
248  'util/u_dl.h',
249  'util/u_draw.c',
250  'util/u_draw.h',
251  'util/u_draw_quad.c',
252  'util/u_draw_quad.h',
253  'util/u_driconf.c',
254  'util/u_driconf.h',
255  'util/u_dual_blend.h',
256  'util/u_dump_defines.c',
257  'util/u_dump.h',
258  'util/u_dump_state.c',
259  'util/u_framebuffer.c',
260  'util/u_framebuffer.h',
261  'util/u_gen_mipmap.c',
262  'util/u_gen_mipmap.h',
263  'util/u_handle_table.c',
264  'util/u_handle_table.h',
265  'util/u_helpers.c',
266  'util/u_helpers.h',
267  'util/u_index_modify.c',
268  'util/u_index_modify.h',
269  'util/u_inlines.h',
270  'util/u_linear.c',
271  'util/u_linear.h',
272  'util/u_live_shader_cache.c',
273  'util/u_live_shader_cache.h',
274  'util/u_log.c',
275  'util/u_log.h',
276  'util/u_network.c',
277  'util/u_network.h',
278  'util/u_pack_color.h',
279  'util/u_pointer.h',
280  'util/u_prim.h',
281  'util/u_prim.c',
282  'util/u_prim_restart.c',
283  'util/u_prim_restart.h',
284  'util/u_pstipple.c',
285  'util/u_pstipple.h',
286  'util/u_pwr8.h',
287  'util/u_range.h',
288  'util/u_rect.h',
289  'util/u_resource.c',
290  'util/u_resource.h',
291  'util/u_sampler.c',
292  'util/u_sampler.h',
293  'util/u_screen.c',
294  'util/u_screen.h',
295  'util/u_simple_shaders.c',
296  'util/u_simple_shaders.h',
297  'util/u_split_draw.c',
298  'util/u_split_draw.h',
299  'util/u_split_prim.h',
300  'util/u_sse.h',
301  'util/u_suballoc.c',
302  'util/u_suballoc.h',
303  'util/u_surface.c',
304  'util/u_surface.h',
305  'util/u_tests.c',
306  'util/u_tests.h',
307  'util/u_texture.c',
308  'util/u_texture.h',
309  'util/u_tile.c',
310  'util/u_tile.h',
311  'util/u_transfer.c',
312  'util/u_transfer.h',
313  'util/u_transfer_helper.c',
314  'util/u_transfer_helper.h',
315  'util/u_threaded_context.c',
316  'util/u_threaded_context.h',
317  'util/u_threaded_context_calls.h',
318  'util/u_trace_gallium.c',
319  'util/u_trace_gallium.h',
320  'util/u_upload_mgr.c',
321  'util/u_upload_mgr.h',
322  'util/u_vbuf.c',
323  'util/u_vbuf.h',
324  'util/u_vertex_state_cache.c',
325  'util/u_vertex_state_cache.h',
326  'util/u_video.h',
327  'util/u_viewport.h',
328  'nir/tgsi_to_nir.c',
329  'nir/tgsi_to_nir.h',
330  'nir/nir_to_tgsi.c',
331  'nir/nir_to_tgsi.h',
332  'nir/nir_draw_helpers.c',
333  'nir/nir_draw_helpers.h',
334)
335
336if dep_libdrm.found()
337  files_libgallium += files(
338    'renderonly/renderonly.c',
339    'renderonly/renderonly.h',
340  )
341endif
342
343if draw_with_llvm
344  files_libgallium += files(
345    'gallivm/lp_bld_arit.c',
346    'gallivm/lp_bld_arit.h',
347    'gallivm/lp_bld_arit_overflow.c',
348    'gallivm/lp_bld_arit_overflow.h',
349    'gallivm/lp_bld_assert.c',
350    'gallivm/lp_bld_assert.h',
351    'gallivm/lp_bld_bitarit.c',
352    'gallivm/lp_bld_bitarit.h',
353    'gallivm/lp_bld_const.c',
354    'gallivm/lp_bld_const.h',
355    'gallivm/lp_bld_conv.c',
356    'gallivm/lp_bld_conv.h',
357    'gallivm/lp_bld_coro.c',
358    'gallivm/lp_bld_coro.h',
359    'gallivm/lp_bld_debug.cpp',
360    'gallivm/lp_bld_debug.h',
361    'gallivm/lp_bld_flow.c',
362    'gallivm/lp_bld_flow.h',
363    'gallivm/lp_bld_format_aos_array.c',
364    'gallivm/lp_bld_format_aos.c',
365    'gallivm/lp_bld_format_float.c',
366    'gallivm/lp_bld_format_s3tc.c',
367    'gallivm/lp_bld_format.c',
368    'gallivm/lp_bld_format.h',
369    'gallivm/lp_bld_format_soa.c',
370    'gallivm/lp_bld_format_srgb.c',
371    'gallivm/lp_bld_format_yuv.c',
372    'gallivm/lp_bld_gather.c',
373    'gallivm/lp_bld_gather.h',
374    'gallivm/lp_bld.h',
375    'gallivm/lp_bld_init.c',
376    'gallivm/lp_bld_init.h',
377    'gallivm/lp_bld_intr.c',
378    'gallivm/lp_bld_intr.h',
379    'gallivm/lp_bld_ir_common.c',
380    'gallivm/lp_bld_ir_common.h',
381    'gallivm/lp_bld_limits.h',
382    'gallivm/lp_bld_logic.c',
383    'gallivm/lp_bld_logic.h',
384    'gallivm/lp_bld_misc.cpp',
385    'gallivm/lp_bld_misc.h',
386    'gallivm/lp_bld_nir.h',
387    'gallivm/lp_bld_nir.c',
388    'gallivm/lp_bld_nir_soa.c',
389    'gallivm/lp_bld_pack.c',
390    'gallivm/lp_bld_pack.h',
391    'gallivm/lp_bld_printf.c',
392    'gallivm/lp_bld_printf.h',
393    'gallivm/lp_bld_quad.c',
394    'gallivm/lp_bld_quad.h',
395    'gallivm/lp_bld_sample_aos.c',
396    'gallivm/lp_bld_sample_aos.h',
397    'gallivm/lp_bld_sample.c',
398    'gallivm/lp_bld_sample.h',
399    'gallivm/lp_bld_sample_soa.c',
400    'gallivm/lp_bld_struct.c',
401    'gallivm/lp_bld_struct.h',
402    'gallivm/lp_bld_swizzle.c',
403    'gallivm/lp_bld_swizzle.h',
404    'gallivm/lp_bld_tgsi_action.c',
405    'gallivm/lp_bld_tgsi_action.h',
406    'gallivm/lp_bld_tgsi_aos.c',
407    'gallivm/lp_bld_tgsi.c',
408    'gallivm/lp_bld_tgsi.h',
409    'gallivm/lp_bld_tgsi_info.c',
410    'gallivm/lp_bld_tgsi_soa.c',
411    'gallivm/lp_bld_type.c',
412    'gallivm/lp_bld_type.h',
413    'draw/draw_llvm.c',
414    'draw/draw_llvm.h',
415    'draw/draw_llvm_sample.c',
416    'draw/draw_pt_fetch_shade_pipeline_llvm.c',
417    'draw/draw_vs_llvm.c',
418    'tessellator/tessellator.cpp',
419    'tessellator/tessellator.hpp',
420    'tessellator/p_tessellator.cpp',
421    'tessellator/p_tessellator.h',
422    'nir/nir_to_tgsi_info.c',
423    'nir/nir_to_tgsi_info.h',
424  )
425endif
426
427files_libgalliumvl = files(
428  'vl/vl_bicubic_filter.c',
429  'vl/vl_bicubic_filter.h',
430  'vl/vl_compositor.c',
431  'vl/vl_compositor.h',
432  'vl/vl_compositor_gfx.c',
433  'vl/vl_compositor_gfx.h',
434  'vl/vl_compositor_cs.c',
435  'vl/vl_compositor_cs.h',
436  'vl/vl_csc.c',
437  'vl/vl_csc.h',
438  'vl/vl_decoder.c',
439  'vl/vl_decoder.h', 'vl/vl_decoder.c',
440  'vl/vl_defines.h',
441  'vl/vl_deint_filter.c',
442  'vl/vl_deint_filter.h',
443  'vl/vl_idct.c',
444  'vl/vl_idct.h',
445  'vl/vl_matrix_filter.c',
446  'vl/vl_matrix_filter.h',
447  'vl/vl_mc.c',
448  'vl/vl_mc.h',
449  'vl/vl_median_filter.c',
450  'vl/vl_median_filter.h',
451  'vl/vl_mpeg12_bitstream.c',
452  'vl/vl_mpeg12_bitstream.h',
453  'vl/vl_mpeg12_decoder.c',
454  'vl/vl_mpeg12_decoder.h',
455  'vl/vl_rbsp.h',
456  'vl/vl_types.h',
457  'vl/vl_vertex_buffers.c',
458  'vl/vl_vertex_buffers.h',
459  'vl/vl_video_buffer.c',
460  'vl/vl_video_buffer.h', 'vl/vl_video_buffer.c',
461  'vl/vl_vlc.h',
462  'vl/vl_zscan.c',
463  'vl/vl_zscan.h',
464  'vl/vl_probs_table.h',
465)
466
467vlwinsys_deps = []
468files_libgalliumvlwinsys = files('vl/vl_winsys.h',
469                                 'vl/vl_winsys_drm.c')
470if with_dri2 and with_platform_x11
471  files_libgalliumvlwinsys += files('vl/vl_winsys_dri.c')
472  if with_dri3
473    vlwinsys_deps += [
474      dep_xcb_sync, dep_xcb_present, dep_xshmfence, dep_xcb_xfixes,
475      dep_xcb_dri3,
476    ]
477    files_libgalliumvlwinsys += files('vl/vl_winsys_dri3.c')
478  endif
479endif
480
481files_libgallium += custom_target(
482  'u_tracepoints.c',
483  input: 'util/u_tracepoints.py',
484  output: 'u_tracepoints.c',
485  command: [
486    prog_python, '@INPUT@',
487    '-p', join_paths(meson.source_root(), 'src/util/perf/'),
488    '-C', '@OUTPUT@',
489  ],
490  depend_files: u_trace_py,
491)
492
493files_u_tracepoints = custom_target(
494  'u_tracepoints.h',
495  input: 'util/u_tracepoints.py',
496  output: 'u_tracepoints.h',
497  command: [
498    prog_python, '@INPUT@',
499    '-p', join_paths(meson.source_root(), 'src/util/perf/'),
500    '-H', '@OUTPUT@',
501  ],
502  depend_files: u_trace_py,
503)
504
505files_libgallium += files_u_tracepoints
506
507idep_u_tracepoints = declare_dependency(
508  sources: files_u_tracepoints,
509)
510
511u_indices_gen_c = custom_target(
512  'u_indices_gen.c',
513  input : 'indices/u_indices_gen.py',
514  output : 'u_indices_gen.c',
515  command : [prog_python, '@INPUT@'],
516  capture : true,
517)
518
519u_unfilled_gen_c = custom_target(
520  'u_unfilled_gen.c',
521  input : 'indices/u_unfilled_gen.py',
522  output : 'u_unfilled_gen.c',
523  command : [prog_python, '@INPUT@'],
524  capture : true,
525)
526
527libgallium_extra_c_args = []
528if with_swrast_vk and with_gallium_zink
529  libgallium_extra_c_args += '-DZINK_WITH_SWRAST_VK'
530endif
531libgallium = static_library(
532  'gallium',
533  [files_libgallium, u_indices_gen_c, u_unfilled_gen_c],
534  include_directories : [
535    inc_loader, inc_gallium, inc_src, inc_include, include_directories('util')
536  ],
537  c_args : [c_msvc_compat_args, libgallium_extra_c_args],
538  cpp_args : [cpp_msvc_compat_args],
539  gnu_symbol_visibility : 'hidden',
540  dependencies : [
541    dep_libdrm, dep_llvm, dep_dl, dep_m, dep_thread, dep_lmsensors, dep_ws2_32,
542    idep_nir, idep_nir_headers, idep_mesautil,
543  ],
544  build_by_default : false
545)
546
547libgalliumvl_stub = static_library(
548  'galliumvl_stub',
549  'vl/vl_stubs.c',
550  c_args : [c_msvc_compat_args],
551  cpp_args : [cpp_msvc_compat_args],
552  gnu_symbol_visibility : 'hidden',
553  include_directories: [inc_gallium, inc_include, inc_src],
554  dependencies : idep_mesautil,
555  build_by_default : false,
556)
557
558libgalliumvl = static_library(
559  'galliumvl',
560  files_libgalliumvl,
561  c_args : [c_msvc_compat_args],
562  cpp_args : [cpp_msvc_compat_args],
563  gnu_symbol_visibility : 'hidden',
564  include_directories : [inc_gallium, inc_include, inc_src],
565  dependencies : idep_mesautil,
566  build_by_default : false,
567)
568
569# XXX: The dependencies here may be off...
570libgalliumvlwinsys = static_library(
571  'galliumvlwinsys',
572  files_libgalliumvlwinsys,
573  include_directories : [inc_gallium, inc_include, inc_loader, inc_src],
574  dependencies : [dep_libdrm, vlwinsys_deps, idep_mesautil],
575  build_by_default : false,
576)
577