blob: 42f0750789a40640c8aff9420dd980b4096c2af7 [file] [log] [blame]
/*
* Copyright (C) 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package {
// See: http://go/android-license-faq
default_applicable_licenses: ["external_mesa3d_license"],
}
filegroup {
name: "nir_opcodes_filegroup",
srcs: [
"nir_opcodes.py",
"nir_algebraic.py",
],
}
python_binary_host {
name: "nir_builder_opcodes_gen",
main: "nir_builder_opcodes_h.py",
srcs: [
"nir_builder_opcodes_h.py",
"nir_opcodes.py",
"nir_intrinsics.py",
],
libs: [
"mako",
],
}
python_binary_host {
name: "nir_constant_expressions_gen",
main: "nir_constant_expressions.py",
srcs: [
"nir_constant_expressions.py",
"nir_opcodes.py",
"nir_intrinsics.py",
],
libs: [
"mako",
],
}
python_binary_host {
name: "nir_opcodes_header_gen",
main: "nir_opcodes_h.py",
srcs: [
"nir_opcodes_h.py",
"nir_opcodes.py",
"nir_intrinsics.py",
],
libs: [
"mako",
],
}
python_binary_host {
name: "nir_opcodes_impl_gen",
main: "nir_opcodes_c.py",
srcs: [
"nir_opcodes_c.py",
"nir_opcodes.py",
"nir_intrinsics.py",
],
libs: [
"mako",
],
}
python_binary_host {
name: "nir_opt_algebraic_gen",
main: "nir_opt_algebraic.py",
srcs: [
"nir_opt_algebraic.py",
"nir_opcodes.py",
"nir_algebraic.py",
],
libs: [
"mako",
],
}
python_binary_host {
name: "nir_intrinsics_header_gen",
main: "nir_intrinsics_h.py",
srcs: [
"nir_intrinsics.py",
"nir_intrinsics_h.py",
],
libs: [
"mako",
],
}
python_binary_host {
name: "nir_intrinsics_indices_gen",
main: "nir_intrinsics_indices_h.py",
srcs: [
"nir_intrinsics_indices_h.py",
"nir_intrinsics.py",
],
libs: [
"mako",
],
}
python_binary_host {
name: "nir_intrinsics_impl_gen",
main: "nir_intrinsics_c.py",
srcs: [
"nir_intrinsics.py",
"nir_intrinsics_c.py",
],
libs: [
"mako",
],
}
genrule {
name: "nir_builder_opcodes_header",
out: ["nir_builder_opcodes.h"],
tools: ["nir_builder_opcodes_gen"],
cmd: "python3 $(location nir_builder_opcodes_gen) " +
"&> $(location nir_builder_opcodes.h)",
}
genrule {
name: "nir_constant_expressions_impl",
out: ["nir_constant_expressions.c"],
tools: ["nir_constant_expressions_gen"],
cmd: "python3 $(location nir_constant_expressions_gen) " +
"&> $(location nir_constant_expressions.c)",
}
genrule {
name: "nir_opcodes_header",
out: ["nir_opcodes.h"],
tools: ["nir_opcodes_header_gen"],
cmd: "python3 $(location nir_opcodes_header_gen) " +
"&> $(location nir_opcodes.h)",
}
genrule {
name: "nir_opcodes_impl",
out: ["nir_opcodes.c"],
tools: ["nir_opcodes_impl_gen"],
cmd: "python3 $(location nir_opcodes_impl_gen) " +
"&> $(location nir_opcodes.c)",
}
genrule {
name: "nir_opt_algebraic_impl",
out: ["nir_opt_algebraic.c"],
tools: ["nir_opt_algebraic_gen"],
cmd: "python3 $(location nir_opt_algebraic_gen) " +
"--out $(location nir_opt_algebraic.c)",
}
genrule {
name: "nir_intrinsics_header",
out: ["nir_intrinsics.h"],
tools: ["nir_intrinsics_header_gen"],
cmd: "python3 $(location nir_intrinsics_header_gen) " +
"--outdir $(genDir)",
}
genrule {
name: "nir_intrinsics_indices_header",
out: ["nir_intrinsics_indices.h"],
tools: ["nir_intrinsics_indices_gen"],
cmd: "python3 $(location nir_intrinsics_indices_gen) " +
"--outdir $(genDir)",
}
genrule {
name: "nir_intrinsics_impl",
out: ["nir_intrinsics.c"],
tools: ["nir_intrinsics_impl_gen"],
cmd: "python3 $(location nir_intrinsics_impl_gen) " +
"--outdir $(genDir)",
}
cc_library_headers {
name: "mesa_nir_headers",
vendor: true,
host_supported: true,
export_include_dirs: [
".",
],
}
cc_library_static {
name: "mesa_nir",
vendor: true,
host_supported: true,
defaults: [
"mesa_common_defaults",
],
generated_headers: [
"nir_builder_opcodes_header",
"nir_opcodes_header",
"nir_intrinsics_header",
"nir_intrinsics_indices_header",
"u_format_gen_header",
"builtin_types_header",
],
generated_sources: [
"nir_constant_expressions_impl",
"nir_opcodes_impl",
"nir_opt_algebraic_impl",
"nir_intrinsics_impl",
],
header_libs: [
"mesa_gallium_auxiliary_headers",
"mesa_gallium_headers",
"mesa_src_headers",
"mesa_compiler_headers",
"mesa_common_headers",
],
srcs: [
"nir.c",
"nir_builder.c",
"nir_builtin_builder.c",
"nir_clone.c",
"nir_control_flow.c",
"nir_functions.c",
"nir_deref.c",
"nir_divergence_analysis.c",
"nir_dominance.c",
"nir_from_ssa.c",
"nir_gather_info.c",
"nir_gather_xfb_info.c",
"nir_gs_count_vertices.c",
"nir_instr_set.c",
"nir_linking_helpers.c",
"nir_liveness.c",
"nir_loop_analyze.c",
"nir_lower_alu_width.c",
"nir_lower_array_deref_of_vec.c",
"nir_lower_bit_size.c",
"nir_lower_bool_to_int32.c",
"nir_lower_clip.c",
"nir_lower_clip_cull_distance_arrays.c",
"nir_lower_convert_alu_types.c",
"nir_lower_double_ops.c",
"nir_lower_flrp.c",
"nir_lower_frexp.c",
"nir_lower_global_vars_to_local.c",
"nir_lower_goto_ifs.c",
"nir_lower_gs_intrinsics.c",
"nir_lower_idiv.c",
"nir_lower_image.c",
"nir_lower_indirect_derefs.c",
"nir_lower_input_attachments.c",
"nir_lower_int64.c",
"nir_lower_interpolation.c",
"nir_lower_io.c",
"nir_lower_io_arrays_to_elements.c",
"nir_lower_io_to_scalar.c",
"nir_lower_io_to_temporaries.c",
"nir_lower_io_to_vector.c",
"nir_lower_load_const_to_scalar.c",
"nir_lower_locals_to_regs.c",
"nir_lower_multiview.c",
"nir_lower_non_uniform_access.c",
"nir_lower_packing.c",
"nir_lower_patch_vertices.c",
"nir_lower_phis_to_scalar.c",
"nir_lower_returns.c",
"nir_lower_scratch.c",
"nir_lower_shader_calls.c",
"nir_lower_single_sampled.c",
"nir_lower_subgroups.c",
"nir_lower_system_values.c",
"nir_lower_sysvals_to_varyings.c",
"nir_lower_task_shader.c",
"nir_lower_tex.c",
"nir_lower_two_sided_color.c",
"nir_lower_var_copies.c",
"nir_lower_variable_initializers.c",
"nir_lower_vars_to_ssa.c",
"nir_lower_wpos_center.c",
"nir_lower_reg_intrinsics_to_ssa.c",
"nir_lower_view_index_to_device_index.c",
"nir_metadata.c",
"nir_move_vec_src_uses_to_dest.c",
"nir_normalize_cubemap_coords.c",
"nir_opt_access.c",
"nir_opt_barriers.c",
"nir_opt_combine_stores.c",
"nir_opt_comparison_pre.c",
"nir_opt_conditional_discard.c",
"nir_opt_constant_folding.c",
"nir_opt_copy_prop_vars.c",
"nir_opt_copy_propagate.c",
"nir_opt_cse.c",
"nir_opt_dce.c",
"nir_opt_dead_cf.c",
"nir_opt_dead_write_vars.c",
"nir_opt_find_array_copies.c",
"nir_opt_gcm.c",
"nir_opt_idiv_const.c",
"nir_opt_if.c",
"nir_opt_intrinsics.c",
"nir_opt_memcpy.c",
"nir_opt_large_constants.c",
"nir_opt_load_store_vectorize.c",
"nir_opt_loop_unroll.c",
"nir_opt_move.c",
"nir_opt_non_uniform_access.c",
"nir_opt_peephole_select.c",
"nir_opt_rematerialize_compares.c",
"nir_opt_ray_queries.c",
"nir_opt_remove_phis.c",
"nir_opt_shrink_stores.c",
"nir_opt_shrink_vectors.c",
"nir_opt_sink.c",
"nir_opt_undef.c",
"nir_opt_uniform_atomics.c",
"nir_phi_builder.c",
"nir_print.c",
"nir_propagate_invariant.c",
"nir_range_analysis.c",
"nir_remove_dead_variables.c",
"nir_repair_ssa.c",
"nir_search.c",
"nir_serialize.c",
"nir_split_per_member_structs.c",
"nir_split_var_copies.c",
"nir_split_vars.c",
"nir_sweep.c",
"nir_to_lcssa.c",
"nir_validate.c",
"nir_worklist.c",
"nir_inline_uniforms.c",
"nir_opt_loop.c",
"nir_opt_loop_unroll.c",
"nir_lower_is_helper_invocation.c",
"nir_lower_mediump.c",
"nir_format_convert.c",
"nir_gather_types.c",
"nir_lower_alu.c",
"nir_lower_vec_to_regs.c",
"nir_lower_fp16_conv.c",
"nir_lower_uniforms_to_ubo.c",
"nir_lower_continue_constructs.c",
"nir_split_64bit_vec3_and_vec4.c",
"nir_opt_vectorize.c",
"nir_fixup_is_exported.c",
"nir_lower_samplers.c",
"nir_opt_phi_precision.c",
"nir_lower_fragcolor.c",
"nir_lower_ubo_vec4.c",
"nir_legacy.c",
"nir_lower_int_to_float.c",
"nir_lower_discard_if.c",
"nir_trivialize_registers.c",
"nir_opt_offsets.c",
"nir_lower_bool_to_float.c",
],
}