Commit d1992255 authored by Dylan Baker's avatar Dylan Baker

meson: Add build Intel "anv" vulkan driver

This allows building and installing the Intel "anv" Vulkan driver using
meson and ninja, the driver has been tested against the CTS and has
seems to pass the same series of tests (they both segfault when the CTS
tries to run wayland wsi tests).

There are still a mess of TODO, XXX, and FIXME comments in here. Those
are mostly for meson bugs I'm trying to fix, or for additional things to
implement for other drivers/features.

I have configured all intermediate libraries and optional tools to not
build by default, meaning they will only be built if they're pulled in
as a dependency of a target that will actually be installed) this allows
us to avoid massive if chains, while ensuring that only the bits that
need to be built are.

v2: - enable anv, x11, and wayland by default
    - add configure option to disable valgrind
v3: - fix typo in meson_options (Nicholas)
v4: - Remove dead code (Eric)
    - Remove change to generator that was from v0 (Eric)
    - replace if chain with loop (Eric)
    - Fix typos (Eric)
    - define HAVE_DLOPEN for both libdl and builtin dl cases (Eric)
v5: - rebase on util string buffer implementation
Signed-off-by: 's avatarDylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net> (v4)
parent c8b9cf42
# Copyright © 2017 Intel Corporation
# 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 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.
inc_drm_uapi = include_directories('drm-uapi')
inc_vulkan = include_directories('vulkan')
This diff is collapsed.
# Copyright © 2017 Intel Corporation
# 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 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.
option('platforms', type : 'string', value : 'x11,wayland',
description : 'comma separated list of window systems to support. wayland, x11, surfaceless, drm, etc.')
option('vulkan-drivers', type : 'string', value : 'intel',
description : 'comma separated list of vulkan drivers to build.')
option('vulkan_icd_dir', type : 'string', value : '',
description : 'Location relative to prefix to put vulkan icds on install. Default: $datadir/vulkan/icd.d')
option('valgrind', type : 'boolean', value : true,
description : 'Build with valgrind support if possible')
option('build-tests', type : 'boolean', value : false,
description : 'Build unit tests. Currently this will build *all* unit tests, which may build more than expected.')
# Copyright © 2017 Intel Corporation
# 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 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.
# TODO: the rest of this file
ir_expression_operation_h = custom_target(
'ir_expression_operation.h',
input : 'ir_expression_operation.py',
output : 'ir_expression_operation.h',
command : [prog_python2, '@INPUT@', 'enum'],
capture : true,
)
# Copyright © 2017 Intel Corporation
# 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 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.
inc_compiler = include_directories('.')
inc_nir = include_directories('nir')
inc_glsl = include_directories('glsl')
subdir('glsl')
files_libcompiler = files(
'builtin_type_macros.h',
'glsl_types.cpp',
'glsl_types.h',
'nir_types.cpp',
'nir_types.h',
'shader_enums.c',
'shader_enums.h',
'shader_info.h',
)
libcompiler = static_library(
'compiler',
[files_libcompiler, ir_expression_operation_h],
include_directories : [inc_mapi, inc_mesa, inc_compiler, inc_common],
c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
build_by_default : false,
)
subdir('nir')
spirv2nir = executable(
'spirv2nir',
[files('spirv/spirv2nir.c'), dummy_cpp],
dependencies : [dep_m, dep_thread],
include_directories : [inc_common, inc_nir, include_directories('spirv')],
link_with : [libnir, libmesa_util],
c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
build_by_default : false,
)
# Copyright © 2017 Intel Corporation
# 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 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.
nir_depends = files('nir_opcodes.py')
nir_builder_opcodes_h = custom_target(
'nir_builder_opcodes.h',
input : 'nir_builder_opcodes_h.py',
output : 'nir_builder_opcodes.h',
command : [prog_python2, '@INPUT@'],
capture : true,
depend_files : nir_depends,
)
nir_constant_expressions_c = custom_target(
'nir_constant_expressions.c',
input : 'nir_constant_expressions.py',
output : 'nir_constant_expressions.c',
command : [prog_python2, '@INPUT@'],
capture : true,
depend_files : nir_depends,
)
nir_opcodes_h = custom_target(
'nir_opcodes.h',
input : 'nir_opcodes_h.py',
output : 'nir_opcodes.h',
command : [prog_python2, '@INPUT@'],
capture : true,
depend_files : nir_depends,
)
nir_opcodes_c = custom_target(
'nir_opcodes.c',
input : 'nir_opcodes_c.py',
output : 'nir_opcodes.c',
command : [prog_python2, '@INPUT@'],
capture : true,
depend_files : nir_depends,
)
nir_opt_algebraic_c = custom_target(
'nir_opt_algebraic.c',
input : 'nir_opt_algebraic.py',
output : 'nir_opt_algebraic.c',
command : [prog_python2, '@INPUT@'],
capture : true,
depend_files : files('nir_algebraic.py'),
)
spirv_info_c = custom_target(
'spirv_info.c',
input : files('../spirv/spirv_info_c.py', '../spirv/spirv.core.grammar.json'),
output : 'spirv_info.c',
command : [prog_python2, '@INPUT0@', '@INPUT1@', '@OUTPUT@'],
)
files_libnir = files(
'nir.c',
'nir.h',
'nir_builder.h',
'nir_clone.c',
'nir_constant_expressions.h',
'nir_control_flow.c',
'nir_control_flow.h',
'nir_control_flow_private.h',
'nir_dominance.c',
'nir_from_ssa.c',
'nir_gather_info.c',
'nir_gs_count_vertices.c',
'nir_inline_functions.c',
'nir_instr_set.c',
'nir_instr_set.h',
'nir_intrinsics.c',
'nir_intrinsics.h',
'nir_liveness.c',
'nir_loop_analyze.c',
'nir_loop_analyze.h',
'nir_lower_64bit_packing.c',
'nir_lower_alu_to_scalar.c',
'nir_lower_atomics.c',
'nir_lower_atomics_to_ssbo.c',
'nir_lower_bitmap.c',
'nir_lower_clamp_color_outputs.c',
'nir_lower_clip.c',
'nir_lower_clip_cull_distance_arrays.c',
'nir_lower_constant_initializers.c',
'nir_lower_double_ops.c',
'nir_lower_drawpixels.c',
'nir_lower_global_vars_to_local.c',
'nir_lower_gs_intrinsics.c',
'nir_lower_load_const_to_scalar.c',
'nir_lower_locals_to_regs.c',
'nir_lower_idiv.c',
'nir_lower_indirect_derefs.c',
'nir_lower_int64.c',
'nir_lower_io.c',
'nir_lower_io_to_temporaries.c',
'nir_lower_io_to_scalar.c',
'nir_lower_io_types.c',
'nir_lower_passthrough_edgeflags.c',
'nir_lower_patch_vertices.c',
'nir_lower_phis_to_scalar.c',
'nir_lower_read_invocation_to_scalar.c',
'nir_lower_regs_to_ssa.c',
'nir_lower_returns.c',
'nir_lower_samplers.c',
'nir_lower_samplers_as_deref.c',
'nir_lower_system_values.c',
'nir_lower_tex.c',
'nir_lower_to_source_mods.c',
'nir_lower_two_sided_color.c',
'nir_lower_uniforms_to_ubo.c',
'nir_lower_vars_to_ssa.c',
'nir_lower_var_copies.c',
'nir_lower_vec_to_movs.c',
'nir_lower_wpos_center.c',
'nir_lower_wpos_ytransform.c',
'nir_metadata.c',
'nir_move_vec_src_uses_to_dest.c',
'nir_normalize_cubemap_coords.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_gcm.c',
'nir_opt_global_to_local.c',
'nir_opt_if.c',
'nir_opt_intrinsics.c',
'nir_opt_loop_unroll.c',
'nir_opt_move_comparisons.c',
'nir_opt_peephole_select.c',
'nir_opt_remove_phis.c',
'nir_opt_trivial_continues.c',
'nir_opt_undef.c',
'nir_phi_builder.c',
'nir_phi_builder.h',
'nir_print.c',
'nir_propagate_invariant.c',
'nir_remove_dead_variables.c',
'nir_repair_ssa.c',
'nir_search.c',
'nir_search.h',
'nir_search_helpers.h',
'nir_split_var_copies.c',
'nir_sweep.c',
'nir_to_lcssa.c',
'nir_validate.c',
'nir_vla.h',
'nir_worklist.c',
'nir_worklist.h',
'../spirv/GLSL.std.450.h',
'../spirv/nir_spirv.h',
'../spirv/spirv.h',
'../spirv/spirv_info.h',
'../spirv/spirv_to_nir.c',
'../spirv/vtn_alu.c',
'../spirv/vtn_cfg.c',
'../spirv/vtn_glsl450.c',
'../spirv/vtn_private.h',
'../spirv/vtn_variables.c',
)
libnir = static_library(
'nir',
[files_libnir, spirv_info_c, nir_opt_algebraic_c, nir_opcodes_c,
nir_opcodes_h, nir_constant_expressions_c, nir_builder_opcodes_h],
include_directories : [inc_common, inc_compiler, include_directories('../spirv')],
c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
link_with : libcompiler,
build_by_default : false,
)
if with_tests
nir_control_flow_test = executable(
'nir_control_flow_test',
[files('tests/control_flow_tests.cpp'), nir_opcodes_h],
c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
include_directories : [inc_common],
dependencies : [dep_thread],
link_with : [libmesa_util, libnir, libgtest],
)
test('nir_control_flow', nir_control_flow_test)
endif
# Copyright © 2017 Intel Corporation
# 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 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.
wayland_drm_xml = files('wayland-drm.xml')
# Copyright © 2017 Intel Corporation
# 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 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.
libgtest = static_library(
'gtest',
files('src/gtest-all.cc', 'src/gtest_main.cc'),
include_directories : include_directories('include'),
build_by_default : false,
)
# Copyright © 2017 Intel Corporation
# 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 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.
files_libblorp = files(
'blorp.c',
'blorp.h',
'blorp_blit.c',
'blorp_clear.c',
'blorp_nir_builder.h',
'blorp_genX_exec.h',
'blorp_priv.h',
)
libblorp = static_library(
'blorp',
[files_libblorp, nir_opcodes_h],
include_directories : [inc_common, inc_intel],
c_args : [c_vis_args, no_override_init_args],
build_by_default : false,
)
# Copyright © 2017 Intel Corporation
# 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 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.
# TODO: android?
files_libintel_common = files(
'gen_clflush.h',
'gen_debug.c',
'gen_debug.h',
'gen_decoder.c',
'gen_decoder.h',
'gen_device_info.c',
'gen_device_info.h',
'gen_l3_config.c',
'gen_l3_config.h',
'gen_urb_config.c',
'gen_sample_positions.h',
)
libintel_common = static_library(
['intel_common', genX_xml_h],
files_libintel_common,
include_directories : [inc_common, inc_intel],
c_args : [c_vis_args, no_override_init_args],
dependencies : dep_libdrm,
build_by_default : false,
)
# Copyright © 2017 Intel Corporation
# 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 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.
libintel_compiler_files = files(
'brw_cfg.cpp',
'brw_cfg.h',
'brw_clip.h',
'brw_clip_line.c',
'brw_clip_point.c',
'brw_clip_tri.c',
'brw_clip_unfilled.c',
'brw_clip_util.c',
'brw_compile_clip.c',
'brw_compile_sf.c',
'brw_compiler.c',
'brw_compiler.h',
'brw_dead_control_flow.cpp',
'brw_dead_control_flow.h',
'brw_disasm.c',
'brw_eu.c',
'brw_eu_compact.c',
'brw_eu_defines.h',
'brw_eu_emit.c',
'brw_eu.h',
'brw_eu_util.c',
'brw_eu_validate.c',
'brw_fs_builder.h',
'brw_fs_cmod_propagation.cpp',
'brw_fs_combine_constants.cpp',
'brw_fs_copy_propagation.cpp',
'brw_fs.cpp',
'brw_fs_cse.cpp',
'brw_fs_dead_code_eliminate.cpp',
'brw_fs_generator.cpp',
'brw_fs.h',
'brw_fs_live_variables.cpp',
'brw_fs_live_variables.h',
'brw_fs_lower_conversions.cpp',
'brw_fs_lower_pack.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_surface_builder.cpp',
'brw_fs_surface_builder.h',
'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.h',
'brw_nir.c',
'brw_nir_analyze_boolean_resolves.c',
'brw_nir_analyze_ubo_ranges.c',
'brw_nir_attribute_workarounds.c',
'brw_nir_intrinsics.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_builder.h',
'brw_vec4_cmod_propagation.cpp',
'brw_vec4_copy_propagation.cpp',
'brw_vec4.cpp',
'brw_vec4_cse.cpp',
'brw_vec4_dead_code_eliminate.cpp',
'brw_vec4_generator.cpp',
'brw_vec4_gs_visitor.cpp',
'brw_vec4_gs_visitor.h',
'brw_vec4.h',
'brw_vec4_live_variables.cpp',
'brw_vec4_live_variables.h',
'brw_vec4_nir.cpp',
'brw_vec4_gs_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_vec4_vs.h',
'brw_vue_map.c',
'brw_wm_iz.cpp',
'gen6_gs_visitor.cpp',
'gen6_gs_visitor.h',
'intel_asm_annotation.c',
'intel_asm_annotation.h',
)
brw_nir_trig = custom_target(
'brw_nir_trig_workarounds.c',
input : 'brw_nir_trig_workarounds.py',
output : 'brw_nir_trig_workarounds.c',
command : [prog_python2, '@INPUT@', '-p',
join_paths(meson.source_root(), 'src/compiler/nir/')],
depend_files : files('../../compiler/nir/nir_algebraic.py'),
capture : true,
)
libintel_compiler = static_library(
'intel_compiler',
[libintel_compiler_files, brw_nir_trig, nir_opcodes_h, nir_builder_opcodes_h,
ir_expression_operation_h],
include_directories : [inc_common, inc_intel, inc_nir],
c_args : [c_vis_args, no_override_init_args],
cpp_args : [cpp_vis_args],
build_by_default : false,
)
if with_tests
# The last two tests are not C++ or gtest, pre comment in autotools make
foreach t : ['fs_cmod_propagation', 'fs_copy_propagation',
'fs_saturate_propagation', 'vf_float_conversions',
'vec4_register_coalesce', 'vec4_copy_propagation',
'vec4_cmod_propagation', 'eu_compact', 'eu_validate']
_exe = executable(
[t, nir_opcodes_h, ir_expression_operation_h],
'test_@0@.cpp'.format(t),
include_directories : [inc_common, inc_intel],
link_with : [libgtest, libintel_compiler, libintel_common, libnir,
libmesa_util, libisl],
dependencies : [dep_thread, dep_dl],
)
test(t, _exe)
endforeach
endif
# Copyright © 2017 Intel Corporation
# 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 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.
gen_xml_files = [
'gen4.xml',
'gen45.xml',
'gen5.xml',
'gen6.xml',
'gen7.xml',
'gen75.xml',
'gen8.xml',
'gen9.xml',
'gen10.xml',
]
genX_xml_h = custom_target(
'genX_xml.h',
input : ['gen_zipped_file.py', gen_xml_files],
output : 'genX_xml.h',
command : [prog_python2, '@INPUT@'],
capture : true,
)
genX_bits_h = custom_target(
'genX_bits.h',
input : ['gen_bits_header.py', gen_xml_files],
output : 'genX_bits.h',
command : [prog_python2, '@INPUT@', '-o', '@OUTPUT@'],
)
gen_xml_pack = []
foreach f : gen_xml_files
_name = '@0@_pack.h'.format(f.split('.')[0])
_xml = custom_target(
_name,
input : ['gen_pack_header.py', f],
output : _name,
command : [prog_python2, '@INPUT@'],
capture : true,
)
gen_xml_pack += _xml
endforeach
# Copyright © 2017 Intel Corporation
# 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 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.
isl_gen_files = files(
'isl_emit_depth_stencil.c',
'isl_surface_state.c',
)
isl_gen4_files = files(
'isl_gen4.c',
'isl_gen4.h',
)
isl_gen6_files = files(
'isl_gen6.c',
'isl_gen6.h',
)
isl_gen7_files = files(
'isl_gen7.c',
'isl_gen7.h',
)
isl_gen8_files = files(
'isl_gen8.c',
'isl_gen8.h',
)
isl_gen9_files = files(
'isl_gen9.c',
'isl_gen9.h',
)
isl_gen_libs = []
foreach g : [['40', isl_gen4_files], ['50', []], ['60', isl_gen6_files],
['70', isl_gen7_files], ['75', []], ['80', isl_gen8_files],
['90', isl_gen9_files], ['100', []]]
_gen = g[0]
_sources = g[1]
_lib = static_library(
'libisl_gen@0@'.format(_gen),
[_sources, isl_gen_files, gen_xml_pack],
include_directories : [inc_common, inc_intel],
c_args : [c_vis_args, no_override_init_args,
'-DGEN_VERSIONx10=@0@'.format(_gen)],
build_by_default : false,
)
isl_gen_libs += _lib
endforeach
isl_format_layout_c = custom_target(
'isl_format_layout.c',
input : ['gen_format_layout.py', 'isl_format_layout.csv'],
output : 'isl_format_layout.c',
command : [prog_python2, '@INPUT0@', '--csv', '@INPUT1@', '--out', '@OUTPUT@'],
)