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