| # Copyright 2023 Google, LLC |
| # |
| # Permission is hereby granted, free of charge, to any person obtaining a |
| # copy of this software and associated documentation files (the "Software"), |
| # to deal in the Software without restriction, including without limitation |
| # the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| # and/or sell copies of the Software, and to permit persons to whom the |
| # Software is furnished to do so, subject to the following conditions: |
| # |
| # The above copyright notice and this permission notice (including the next |
| # paragraph) shall be included in all copies or substantial portions of the |
| # Software. |
| # |
| # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
| # IN THE SOFTWARE. |
| |
| import("../../../mesa.gni") |
| |
| mesa_source_set("gallivm") { |
| sources = [ |
| "draw/draw_llvm.c", |
| "draw/draw_llvm.h", |
| "draw/draw_llvm_sample.c", |
| "draw/draw_pt_fetch_shade_pipeline_llvm.c", |
| "draw/draw_vs_llvm.c", |
| "gallivm/lp_bld.h", |
| "gallivm/lp_bld_arit.c", |
| "gallivm/lp_bld_arit.h", |
| "gallivm/lp_bld_arit_overflow.c", |
| "gallivm/lp_bld_arit_overflow.h", |
| "gallivm/lp_bld_assert.c", |
| "gallivm/lp_bld_assert.h", |
| "gallivm/lp_bld_bitarit.c", |
| "gallivm/lp_bld_bitarit.h", |
| "gallivm/lp_bld_const.c", |
| "gallivm/lp_bld_const.h", |
| "gallivm/lp_bld_conv.c", |
| "gallivm/lp_bld_conv.h", |
| "gallivm/lp_bld_coro.c", |
| "gallivm/lp_bld_coro.h", |
| "gallivm/lp_bld_debug.cpp", |
| "gallivm/lp_bld_debug.h", |
| "gallivm/lp_bld_flow.c", |
| "gallivm/lp_bld_flow.h", |
| "gallivm/lp_bld_format.c", |
| "gallivm/lp_bld_format.h", |
| "gallivm/lp_bld_format_aos.c", |
| "gallivm/lp_bld_format_aos_array.c", |
| "gallivm/lp_bld_format_float.c", |
| "gallivm/lp_bld_format_s3tc.c", |
| "gallivm/lp_bld_format_soa.c", |
| "gallivm/lp_bld_format_srgb.c", |
| "gallivm/lp_bld_format_yuv.c", |
| "gallivm/lp_bld_fuchsia_memory_mapper.cpp", |
| "gallivm/lp_bld_fuchsia_memory_mapper.hpp", |
| "gallivm/lp_bld_gather.c", |
| "gallivm/lp_bld_gather.h", |
| "gallivm/lp_bld_init.c", |
| "gallivm/lp_bld_init.h", |
| "gallivm/lp_bld_intr.c", |
| "gallivm/lp_bld_intr.h", |
| "gallivm/lp_bld_ir_common.c", |
| "gallivm/lp_bld_ir_common.h", |
| "gallivm/lp_bld_jit_types.c", |
| "gallivm/lp_bld_jit_types.h", |
| "gallivm/lp_bld_limits.h", |
| "gallivm/lp_bld_logic.c", |
| "gallivm/lp_bld_logic.h", |
| "gallivm/lp_bld_misc.cpp", |
| "gallivm/lp_bld_misc.h", |
| "gallivm/lp_bld_nir.c", |
| "gallivm/lp_bld_nir.h", |
| "gallivm/lp_bld_nir_aos.c", |
| "gallivm/lp_bld_nir_soa.c", |
| "gallivm/lp_bld_pack.c", |
| "gallivm/lp_bld_pack.h", |
| "gallivm/lp_bld_printf.c", |
| "gallivm/lp_bld_printf.h", |
| "gallivm/lp_bld_quad.c", |
| "gallivm/lp_bld_quad.h", |
| "gallivm/lp_bld_sample.c", |
| "gallivm/lp_bld_sample.h", |
| "gallivm/lp_bld_sample_aos.c", |
| "gallivm/lp_bld_sample_aos.h", |
| "gallivm/lp_bld_sample_soa.c", |
| "gallivm/lp_bld_struct.c", |
| "gallivm/lp_bld_struct.h", |
| "gallivm/lp_bld_swizzle.c", |
| "gallivm/lp_bld_swizzle.h", |
| "gallivm/lp_bld_tgsi.c", |
| "gallivm/lp_bld_tgsi.h", |
| "gallivm/lp_bld_tgsi_action.c", |
| "gallivm/lp_bld_tgsi_action.h", |
| "gallivm/lp_bld_tgsi_aos.c", |
| "gallivm/lp_bld_tgsi_info.c", |
| "gallivm/lp_bld_tgsi_soa.c", |
| "gallivm/lp_bld_type.c", |
| "gallivm/lp_bld_type.h", |
| "nir/nir_to_tgsi_info.c", |
| "nir/nir_to_tgsi_info.h", |
| "tessellator/p_tessellator.cpp", |
| "tessellator/p_tessellator.h", |
| "tessellator/tessellator.cpp", |
| "tessellator/tessellator.hpp", |
| ] |
| |
| include_dirs = [ |
| "$mesa_build_root/include/", |
| "$mesa_build_root/src/compiler/nir", |
| "$mesa_build_root/src/gallium/auxiliary/", |
| "$mesa_build_root/src/gallium/include/", |
| "$mesa_build_root/src/", |
| ] |
| |
| deps = [ |
| ":gen", |
| "$mesa_build_root/src/compiler/nir", |
| # TODO(https://fxbug.dev/321122796): |
| # These are for marking JIT memory as executable in lp_bld_fuchsia_memory_mapper.cpp. |
| # Perhaps this functionality should be moved into a separate target? |
| "//sdk/fidl/fuchsia.vulkan.loader:fuchsia.vulkan.loader_cpp", |
| "//sdk/lib/component/incoming/cpp", |
| ] |
| |
| # Suppress warnings. |
| configs = [ |
| "$mesa_build_root:build_config", |
| "//build/config:Wno-unused-but-set-variable", |
| "//build/config:Wno-strict-prototypes", |
| "//third_party/mesa:LLVMHeader_config", |
| ] |
| } |
| |
| mesa_source_set("auxiliary") { |
| deps = [ |
| ":gallivm", |
| ":gen", |
| "$mesa_build_root/src/compiler/nir", |
| ] |
| |
| sources = [ |
| "cso_cache/cso_cache.c", |
| "cso_cache/cso_cache.h", |
| "cso_cache/cso_context.c", |
| "cso_cache/cso_context.h", |
| "cso_cache/cso_hash.c", |
| "cso_cache/cso_hash.h", |
| "draw/draw_cliptest_tmp.h", |
| "draw/draw_context.c", |
| "draw/draw_context.h", |
| "draw/draw_decompose_tmp.h", |
| "draw/draw_fs.c", |
| "draw/draw_fs.h", |
| "draw/draw_gs.c", |
| "draw/draw_gs.h", |
| "draw/draw_gs_tmp.h", |
| "draw/draw_pipe.c", |
| "draw/draw_pipe.h", |
| "draw/draw_pipe_aaline.c", |
| "draw/draw_pipe_aapoint.c", |
| "draw/draw_pipe_clip.c", |
| "draw/draw_pipe_cull.c", |
| "draw/draw_pipe_flatshade.c", |
| "draw/draw_pipe_offset.c", |
| "draw/draw_pipe_pstipple.c", |
| "draw/draw_pipe_stipple.c", |
| "draw/draw_pipe_twoside.c", |
| "draw/draw_pipe_unfilled.c", |
| "draw/draw_pipe_user_cull.c", |
| "draw/draw_pipe_util.c", |
| "draw/draw_pipe_validate.c", |
| "draw/draw_pipe_vbuf.c", |
| "draw/draw_pipe_wide_line.c", |
| "draw/draw_pipe_wide_point.c", |
| "draw/draw_prim_assembler.c", |
| "draw/draw_prim_assembler.h", |
| "draw/draw_prim_assembler_tmp.h", |
| "draw/draw_private.h", |
| "draw/draw_pt.c", |
| "draw/draw_pt.h", |
| "draw/draw_pt_decompose.h", |
| "draw/draw_pt_emit.c", |
| "draw/draw_pt_fetch.c", |
| "draw/draw_pt_fetch_shade_emit.c", |
| "draw/draw_pt_fetch_shade_pipeline.c", |
| "draw/draw_pt_post_vs.c", |
| "draw/draw_pt_so_emit.c", |
| "draw/draw_pt_util.c", |
| "draw/draw_pt_vsplit.c", |
| "draw/draw_pt_vsplit_tmp.h", |
| "draw/draw_so_emit_tmp.h", |
| "draw/draw_split_tmp.h", |
| "draw/draw_tess.c", |
| "draw/draw_tess.h", |
| "draw/draw_vbuf.h", |
| "draw/draw_vertex.c", |
| "draw/draw_vertex.h", |
| "draw/draw_vs.c", |
| "draw/draw_vs.h", |
| "draw/draw_vs_exec.c", |
| "draw/draw_vs_variant.c", |
| "driver_ddebug/dd_context.c", |
| "driver_ddebug/dd_draw.c", |
| "driver_ddebug/dd_pipe.h", |
| "driver_ddebug/dd_public.h", |
| "driver_ddebug/dd_screen.c", |
| "driver_ddebug/dd_util.h", |
| "driver_noop/noop_pipe.c", |
| "driver_noop/noop_public.h", |
| "driver_noop/noop_state.c", |
| "driver_trace/tr_context.c", |
| "driver_trace/tr_context.h", |
| "driver_trace/tr_dump.c", |
| "driver_trace/tr_dump.h", |
| "driver_trace/tr_dump_defines.h", |
| "driver_trace/tr_dump_state.c", |
| "driver_trace/tr_dump_state.h", |
| "driver_trace/tr_public.h", |
| "driver_trace/tr_screen.c", |
| "driver_trace/tr_screen.h", |
| "driver_trace/tr_texture.c", |
| "driver_trace/tr_texture.h", |
| "hud/font.c", |
| "hud/font.h", |
| "hud/hud_context.c", |
| "hud/hud_context.h", |
| "hud/hud_cpu.c", |
| "hud/hud_cpufreq.c", |
| "hud/hud_diskstat.c", |
| "hud/hud_driver_query.c", |
| "hud/hud_fps.c", |
| "hud/hud_nic.c", |
| "hud/hud_private.h", |
| "hud/hud_sensors_temp.c", |
| "indices/u_indices.h", |
| "indices/u_indices_priv.h", |
| "indices/u_primconvert.c", |
| "indices/u_primconvert.h", |
| "nir/nir_draw_helpers.c", |
| "nir/nir_draw_helpers.h", |
| "nir/nir_helpers.c", |
| "nir/nir_helpers.h", |
| "nir/nir_to_tgsi.c", |
| "nir/nir_to_tgsi.h", |
| "nir/tgsi_to_nir.c", |
| "nir/tgsi_to_nir.h", |
| "os/os_mman.h", |
| "os/os_process.c", |
| "os/os_process.h", |
| "os/os_thread.h", |
| "pipebuffer/pb_buffer.h", |
| "pipebuffer/pb_buffer_fenced.c", |
| "pipebuffer/pb_buffer_fenced.h", |
| "pipebuffer/pb_bufmgr.h", |
| "pipebuffer/pb_bufmgr_cache.c", |
| "pipebuffer/pb_bufmgr_debug.c", |
| "pipebuffer/pb_bufmgr_mm.c", |
| "pipebuffer/pb_bufmgr_slab.c", |
| "pipebuffer/pb_cache.c", |
| "pipebuffer/pb_cache.h", |
| "pipebuffer/pb_slab.c", |
| "pipebuffer/pb_slab.h", |
| "pipebuffer/pb_validate.c", |
| "pipebuffer/pb_validate.h", |
| "postprocess/filters.h", |
| "postprocess/postprocess.h", |
| "postprocess/pp_celshade.c", |
| "postprocess/pp_celshade.h", |
| "postprocess/pp_colors.c", |
| "postprocess/pp_colors.h", |
| "postprocess/pp_filters.h", |
| "postprocess/pp_init.c", |
| "postprocess/pp_mlaa.c", |
| "postprocess/pp_mlaa.h", |
| "postprocess/pp_mlaa_areamap.h", |
| "postprocess/pp_private.h", |
| "postprocess/pp_program.c", |
| "postprocess/pp_run.c", |
| "rtasm/rtasm_execmem.c", |
| "rtasm/rtasm_execmem.h", |
| "rtasm/rtasm_x86sse.c", |
| "rtasm/rtasm_x86sse.h", |
| "tgsi/tgsi_aa_point.c", |
| "tgsi/tgsi_aa_point.h", |
| "tgsi/tgsi_build.c", |
| "tgsi/tgsi_build.h", |
| "tgsi/tgsi_dump.c", |
| "tgsi/tgsi_dump.h", |
| "tgsi/tgsi_dynamic_indexing.c", |
| "tgsi/tgsi_exec.c", |
| "tgsi/tgsi_exec.h", |
| "tgsi/tgsi_from_mesa.c", |
| "tgsi/tgsi_from_mesa.h", |
| "tgsi/tgsi_info.c", |
| "tgsi/tgsi_info.h", |
| "tgsi/tgsi_info_opcodes.h", |
| "tgsi/tgsi_iterate.c", |
| "tgsi/tgsi_iterate.h", |
| "tgsi/tgsi_lowering.c", |
| "tgsi/tgsi_lowering.h", |
| "tgsi/tgsi_opcode_tmp.h", |
| "tgsi/tgsi_parse.c", |
| "tgsi/tgsi_parse.h", |
| "tgsi/tgsi_point_sprite.c", |
| "tgsi/tgsi_point_sprite.h", |
| "tgsi/tgsi_sanity.c", |
| "tgsi/tgsi_sanity.h", |
| "tgsi/tgsi_scan.c", |
| "tgsi/tgsi_scan.h", |
| "tgsi/tgsi_strings.c", |
| "tgsi/tgsi_strings.h", |
| "tgsi/tgsi_text.c", |
| "tgsi/tgsi_text.h", |
| "tgsi/tgsi_transform.c", |
| "tgsi/tgsi_transform.h", |
| "tgsi/tgsi_two_side.c", |
| "tgsi/tgsi_two_side.h", |
| "tgsi/tgsi_ureg.c", |
| "tgsi/tgsi_ureg.h", |
| "tgsi/tgsi_util.c", |
| "tgsi/tgsi_util.h", |
| "tgsi/tgsi_vpos.c", |
| "translate/translate.c", |
| "translate/translate.h", |
| "translate/translate_cache.c", |
| "translate/translate_cache.h", |
| "translate/translate_generic.c", |
| "translate/translate_sse.c", |
| "util/dbghelp.h", |
| "util/u_async_debug.c", |
| "util/u_async_debug.h", |
| "util/u_bitcast.h", |
| "util/u_bitmask.c", |
| "util/u_bitmask.h", |
| "util/u_blend.h", |
| "util/u_blitter.c", |
| "util/u_blitter.h", |
| "util/u_box.h", |
| "util/u_cache.c", |
| "util/u_cache.h", |
| "util/u_compute.c", |
| "util/u_compute.h", |
| "util/u_debug_cb.h", |
| "util/u_debug_flush.c", |
| "util/u_debug_flush.h", |
| "util/u_debug_image.c", |
| "util/u_debug_image.h", |
| "util/u_dirty_flags.h", |
| "util/u_dirty_surfaces.h", |
| "util/u_draw.c", |
| "util/u_draw.h", |
| "util/u_draw_quad.c", |
| "util/u_draw_quad.h", |
| "util/u_driconf.c", |
| "util/u_driconf.h", |
| "util/u_dual_blend.h", |
| "util/u_dump.h", |
| "util/u_dump_defines.c", |
| "util/u_dump_state.c", |
| "util/u_framebuffer.c", |
| "util/u_framebuffer.h", |
| "util/u_gen_mipmap.c", |
| "util/u_gen_mipmap.h", |
| "util/u_handle_table.c", |
| "util/u_handle_table.h", |
| "util/u_helpers.c", |
| "util/u_helpers.h", |
| "util/u_index_modify.c", |
| "util/u_index_modify.h", |
| "util/u_inlines.h", |
| "util/u_linear.c", |
| "util/u_linear.h", |
| "util/u_live_shader_cache.c", |
| "util/u_live_shader_cache.h", |
| "util/u_log.c", |
| "util/u_log.h", |
| "util/u_pack_color.h", |
| "util/u_prim.c", |
| "util/u_prim.h", |
| "util/u_prim_restart.c", |
| "util/u_prim_restart.h", |
| "util/u_pstipple.c", |
| "util/u_pstipple.h", |
| "util/u_pwr8.h", |
| "util/u_range.h", |
| "util/u_rect.h", |
| "util/u_resource.c", |
| "util/u_resource.h", |
| "util/u_sampler.c", |
| "util/u_sampler.h", |
| "util/u_screen.c", |
| "util/u_screen.h", |
| "util/u_simple_shaders.c", |
| "util/u_simple_shaders.h", |
| "util/u_split_draw.c", |
| "util/u_split_draw.h", |
| "util/u_split_prim.h", |
| "util/u_sse.h", |
| "util/u_suballoc.c", |
| "util/u_suballoc.h", |
| "util/u_surface.c", |
| "util/u_surface.h", |
| "util/u_tests.c", |
| "util/u_tests.h", |
| "util/u_texture.c", |
| "util/u_texture.h", |
| "util/u_threaded_context.c", |
| "util/u_threaded_context.h", |
| "util/u_threaded_context_calls.h", |
| "util/u_tile.c", |
| "util/u_tile.h", |
| "util/u_trace_gallium.c", |
| "util/u_trace_gallium.h", |
| "util/u_transfer.c", |
| "util/u_transfer.h", |
| "util/u_transfer_helper.c", |
| "util/u_transfer_helper.h", |
| "util/u_upload_mgr.c", |
| "util/u_upload_mgr.h", |
| "util/u_vbuf.c", |
| "util/u_vbuf.h", |
| "util/u_vertex_state_cache.c", |
| "util/u_vertex_state_cache.h", |
| "util/u_video.h", |
| "util/u_viewport.h", |
| ] |
| |
| configs = [ |
| ":build_config", |
| "//build/config:Wno-strict-prototypes", |
| "$mesa_build_root:build_config", |
| ] |
| } |
| |
| config("build_config") { |
| include_dirs = [ |
| "$mesa_build_root/include/", |
| "$mesa_build_root/src/compiler/nir/", |
| "$mesa_build_root/src/gallium/auxiliary/", |
| "$mesa_build_root/src/gallium/include/", |
| "$mesa_build_root/src/util/", |
| "$mesa_build_root/src/", |
| "$target_gen_dir", |
| ] |
| |
| configs = [ "//third_party/mesa:LLVMHeader_config" ] |
| } |
| |
| mesa_python_action("tr_util_gen") { |
| h_file = "$target_gen_dir/driver_trace/tr_util.h" |
| c_file = "$target_gen_dir/driver_trace/tr_util.c" |
| |
| outputs = [ |
| h_file, |
| c_file, |
| ] |
| |
| script = "driver_trace/enums2names.py" |
| |
| inputs = [ "$mesa_build_root/src/gallium/include/pipe/p_defines.h" ] |
| |
| args = [ |
| rebase_path("$mesa_build_root", root_build_dir) + |
| "/src/gallium/include/pipe/p_defines.h", |
| "-C", |
| rebase_path(c_file, root_build_dir), |
| "-H", |
| rebase_path(h_file, root_build_dir), |
| "-I", |
| "tr_util.h", |
| ] |
| } |
| |
| mesa_python_action("u_indices_gen") { |
| output_path = "$target_gen_dir/indices/u_indices_gen.c" |
| |
| outputs = [ output_path ] |
| script = "indices/u_indices_gen.py" |
| |
| args = [ rebase_path(output_path, root_build_dir) ] |
| } |
| |
| mesa_python_action("u_tracepoints_gen") { |
| output_path = "$target_gen_dir/u_tracepoints.h" |
| |
| script = "util/u_tracepoints.py" |
| outputs = [ output_path ] |
| |
| args = [ |
| "-p", |
| rebase_path("$mesa_build_root/src/util/perf", root_build_dir), |
| "-H", |
| rebase_path(output_path, root_build_dir), |
| ] |
| } |
| |
| mesa_python_action("u_unfilled_gen") { |
| output_path = "$target_gen_dir/indices/u_unfilled_gen.c" |
| |
| outputs = [ output_path ] |
| script = "indices/u_unfilled_gen.py" |
| |
| args = [ rebase_path(output_path, root_build_dir) ] |
| } |
| |
| config("gen_public_config") { |
| include_dirs = [ |
| target_gen_dir, |
| "$mesa_build_root/include/", |
| "$mesa_build_root/src/", |
| "$mesa_build_root/src/gallium/auxiliary/", |
| "$mesa_build_root/src/gallium/auxiliary/driver_trace/", |
| "$mesa_build_root/src/gallium/include/", |
| "$mesa_build_root/src/util/", |
| "$target_gen_dir/driver_trace/", |
| ] |
| } |
| |
| mesa_source_set("gen") { |
| public_configs = [ ":gen_public_config" ] |
| |
| deps = [ |
| ":u_indices_gen", |
| ":u_tracepoints_gen", |
| ":u_unfilled_gen", |
| ":tr_util_gen", |
| ] |
| |
| sources = [ |
| "$target_gen_dir/driver_trace/tr_util.c", |
| "$target_gen_dir/driver_trace/tr_util.h", |
| "$target_gen_dir/indices/u_indices_gen.c", |
| "$target_gen_dir/indices/u_unfilled_gen.c", |
| "$target_gen_dir/u_tracepoints.h", |
| ] |
| } |