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