blob: 3fa0cdb5af2665aff5dfeb6a0bcb41d690221ac9 [file] [log] [blame]
# Copyright 2017 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")
config("compiler_config") {
include_dirs = [
".",
"$mesa_build_root/src/mesa", # because brw_compiler.h includes main/mtypes.h
"$mesa_build_root/src/gallium/auxiliary", # because main/macros.h includes gallium/auxiliary/util/u_math.h
"$mesa_build_root/src/gallium/include", # because u_math.h includes pipe/p_compiler.h
"$mesa_build_root/src/intel", # because brw_compiler.h includes common/gen_device_info.h
]
}
mesa_source_set("compiler") {
public_configs = [ ":compiler_config" ]
public_deps = [
"$mesa_build_root/src/compiler",
]
deps = [
":gen_brw_nir_trig_workarounds",
"$mesa_build_root/include:c_compat",
"$mesa_build_root/src/compiler/glsl:ir_expression_operation",
"$mesa_build_root/src/compiler/nir",
"$mesa_build_root/src/intel:isl",
"$mesa_build_root/src/util",
]
sources = [
"$target_gen_dir/brw_nir_trig_workarounds.c",
"brw_cfg.cpp",
"brw_cfg.h",
"brw_compile_sf.c",
"brw_compiler.c",
"brw_compiler.h",
"brw_dead_control_flow.cpp",
"brw_dead_control_flow.h",
"brw_disasm.c",
"brw_disasm_info.c",
"brw_eu.c",
"brw_eu.h",
"brw_eu_compact.c",
"brw_eu_emit.c",
"brw_eu_util.c",
"brw_eu_validate.c",
"brw_fs.cpp",
"brw_fs.h",
"brw_fs_bank_conflicts.cpp",
"brw_fs_builder.h",
"brw_fs_cmod_propagation.cpp",
"brw_fs_combine_constants.cpp",
"brw_fs_copy_propagation.cpp",
"brw_fs_cse.cpp",
"brw_fs_dead_code_eliminate.cpp",
"brw_fs_generator.cpp",
"brw_fs_live_variables.cpp",
"brw_fs_live_variables.h",
"brw_fs_lower_pack.cpp",
"brw_fs_lower_regioning.cpp",
"brw_fs_nir.cpp",
"brw_fs_reg_allocate.cpp",
"brw_fs_register_coalesce.cpp",
"brw_fs_saturate_propagation.cpp",
"brw_fs_sel_peephole.cpp",
"brw_fs_validate.cpp",
"brw_fs_visitor.cpp",
"brw_inst.h",
"brw_interpolation_map.c",
"brw_ir_allocator.h",
"brw_ir_fs.h",
"brw_ir_vec4.h",
"brw_nir.c",
"brw_nir.h",
"brw_nir_analyze_boolean_resolves.c",
"brw_nir_analyze_ubo_ranges.c",
"brw_nir_attribute_workarounds.c",
"brw_nir_lower_conversions.c",
"brw_nir_lower_cs_intrinsics.c",
"brw_nir_lower_image_load_store.c",
"brw_nir_lower_mem_access_bit_sizes.c",
"brw_nir_opt_peephole_ffma.c",
"brw_nir_tcs_workarounds.c",
"brw_packed_float.c",
"brw_predicated_break.cpp",
"brw_reg.h",
"brw_reg_type.c",
"brw_reg_type.h",
"brw_schedule_instructions.cpp",
"brw_shader.cpp",
"brw_shader.h",
"brw_vec4.cpp",
"brw_vec4.h",
"brw_vec4_builder.h",
"brw_vec4_cmod_propagation.cpp",
"brw_vec4_copy_propagation.cpp",
"brw_vec4_cse.cpp",
"brw_vec4_dead_code_eliminate.cpp",
"brw_vec4_generator.cpp",
"brw_vec4_gs_nir.cpp",
"brw_vec4_gs_visitor.cpp",
"brw_vec4_gs_visitor.h",
"brw_vec4_live_variables.cpp",
"brw_vec4_live_variables.h",
"brw_vec4_nir.cpp",
"brw_vec4_reg_allocate.cpp",
"brw_vec4_surface_builder.cpp",
"brw_vec4_surface_builder.h",
"brw_vec4_tcs.cpp",
"brw_vec4_tcs.h",
"brw_vec4_tes.cpp",
"brw_vec4_tes.h",
"brw_vec4_visitor.cpp",
"brw_vec4_vs_visitor.cpp",
"brw_vue_map.c",
"brw_wm_iz.cpp",
"gen6_gs_visitor.cpp",
"gen6_gs_visitor.h",
]
}
action("gen_brw_nir_trig_workarounds") {
output_name = "brw_nir_trig_workarounds.c"
script_name = "brw_nir_trig_workarounds.py"
script = "$mesa_build_root/scripts/gn_script_wrapper.py"
outputs = [
"$target_gen_dir/$output_name",
]
inputs = [
"$mesa_build_root/src/compiler/nir/nir_algebraic.py",
]
python_path = "$magma_python_path:" + rebase_path("$mesa_build_root") +
"/src/compiler/nir"
args = [
"$python_path",
rebase_path("$target_gen_dir") + "/$output_name",
rebase_path(".") + "/$script_name",
"--import-path",
"$python_path",
]
}