2017-09-20 19:53:29 +01:00
|
|
|
# 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.
|
|
|
|
|
|
|
|
radv_entrypoints = custom_target(
|
2021-01-25 01:11:57 +00:00
|
|
|
'radv_entrypoints',
|
|
|
|
input : [vk_entrypoints_gen, vk_api_xml],
|
2017-09-20 19:53:29 +01:00
|
|
|
output : ['radv_entrypoints.h', 'radv_entrypoints.c'],
|
2017-12-11 23:56:08 +00:00
|
|
|
command : [
|
2021-01-25 01:11:57 +00:00
|
|
|
prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',
|
|
|
|
'--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'radv',
|
|
|
|
'--device-prefix', 'sqtt',
|
2017-12-11 23:56:08 +00:00
|
|
|
],
|
2017-09-20 19:53:29 +01:00
|
|
|
)
|
|
|
|
|
2017-10-17 18:58:28 +01:00
|
|
|
radv_extensions_c = custom_target(
|
2017-10-17 11:59:48 +01:00
|
|
|
'radv_extensions.c',
|
2018-04-10 06:01:14 +01:00
|
|
|
input : ['radv_extensions.py', vk_api_xml],
|
2018-02-10 20:43:55 +00:00
|
|
|
output : ['radv_extensions.c', 'radv_extensions.h'],
|
2017-12-11 23:56:08 +00:00
|
|
|
command : [
|
2018-08-09 09:27:26 +01:00
|
|
|
prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--out-c', '@OUTPUT0@',
|
2018-02-10 20:43:55 +00:00
|
|
|
'--out-h', '@OUTPUT1@'
|
2017-12-11 23:56:08 +00:00
|
|
|
],
|
2021-01-28 19:51:57 +00:00
|
|
|
depend_files : vk_extensions_gen,
|
2017-10-17 11:59:48 +01:00
|
|
|
)
|
|
|
|
|
2019-03-12 23:38:02 +00:00
|
|
|
amd_vk_format_table_c = custom_target(
|
|
|
|
'amd_vk_format_table.c',
|
2017-09-20 19:53:29 +01:00
|
|
|
input : ['vk_format_table.py', 'vk_format_layout.csv'],
|
|
|
|
output : 'vk_format_table.c',
|
2018-08-09 09:27:26 +01:00
|
|
|
command : [prog_python, '@INPUT@'],
|
2017-09-20 19:53:29 +01:00
|
|
|
depend_files : files('vk_format_parse.py'),
|
|
|
|
capture : true,
|
|
|
|
)
|
|
|
|
|
|
|
|
libradv_files = files(
|
2020-02-26 13:05:15 +00:00
|
|
|
'layers/radv_sqtt_layer.c',
|
2020-02-17 13:45:47 +00:00
|
|
|
'winsys/null/radv_null_bo.c',
|
|
|
|
'winsys/null/radv_null_bo.h',
|
|
|
|
'winsys/null/radv_null_cs.c',
|
|
|
|
'winsys/null/radv_null_cs.h',
|
|
|
|
'winsys/null/radv_null_winsys.c',
|
|
|
|
'winsys/null/radv_null_winsys_public.h',
|
2019-09-24 15:33:39 +01:00
|
|
|
'radv_android.c',
|
2017-09-20 19:53:29 +01:00
|
|
|
'radv_cmd_buffer.c',
|
|
|
|
'radv_cs.h',
|
|
|
|
'radv_debug.c',
|
|
|
|
'radv_debug.h',
|
|
|
|
'radv_device.c',
|
|
|
|
'radv_descriptor_set.c',
|
|
|
|
'radv_descriptor_set.h',
|
|
|
|
'radv_formats.c',
|
|
|
|
'radv_image.c',
|
2018-06-27 02:34:25 +01:00
|
|
|
'radv_llvm_helper.cpp',
|
2017-09-20 19:53:29 +01:00
|
|
|
'radv_meta.c',
|
|
|
|
'radv_meta.h',
|
|
|
|
'radv_meta_blit.c',
|
|
|
|
'radv_meta_blit2d.c',
|
|
|
|
'radv_meta_buffer.c',
|
|
|
|
'radv_meta_bufimage.c',
|
|
|
|
'radv_meta_clear.c',
|
|
|
|
'radv_meta_copy.c',
|
|
|
|
'radv_meta_decompress.c',
|
|
|
|
'radv_meta_fast_clear.c',
|
2018-12-17 19:59:33 +00:00
|
|
|
'radv_meta_fmask_expand.c',
|
2017-09-20 19:53:29 +01:00
|
|
|
'radv_meta_resolve.c',
|
|
|
|
'radv_meta_resolve_cs.c',
|
|
|
|
'radv_meta_resolve_fs.c',
|
2019-03-21 00:29:52 +00:00
|
|
|
'radv_nir_lower_ycbcr_textures.c',
|
2018-03-09 15:58:10 +00:00
|
|
|
'radv_nir_to_llvm.c',
|
2017-09-20 19:53:29 +01:00
|
|
|
'radv_pass.c',
|
|
|
|
'radv_pipeline.c',
|
|
|
|
'radv_pipeline_cache.c',
|
|
|
|
'radv_private.h',
|
|
|
|
'radv_radeon_winsys.h',
|
|
|
|
'radv_shader.c',
|
|
|
|
'radv_shader.h',
|
2019-11-11 17:05:03 +00:00
|
|
|
'radv_shader_args.c',
|
2019-11-11 11:50:12 +00:00
|
|
|
'radv_shader_args.h',
|
2018-06-27 02:34:25 +01:00
|
|
|
'radv_shader_helper.h',
|
2018-03-13 13:49:11 +00:00
|
|
|
'radv_shader_info.c',
|
2020-02-18 07:32:33 +00:00
|
|
|
'radv_sqtt.c',
|
2017-09-20 19:53:29 +01:00
|
|
|
'radv_query.c',
|
|
|
|
'radv_util.c',
|
|
|
|
'radv_wsi.c',
|
|
|
|
'si_cmd_buffer.c',
|
|
|
|
'vk_format.h',
|
|
|
|
)
|
|
|
|
|
2020-11-27 02:43:11 +00:00
|
|
|
if not with_platform_windows
|
|
|
|
libradv_files += files(
|
|
|
|
'winsys/amdgpu/radv_amdgpu_bo.c',
|
|
|
|
'winsys/amdgpu/radv_amdgpu_bo.h',
|
|
|
|
'winsys/amdgpu/radv_amdgpu_cs.c',
|
|
|
|
'winsys/amdgpu/radv_amdgpu_cs.h',
|
|
|
|
'winsys/amdgpu/radv_amdgpu_surface.c',
|
|
|
|
'winsys/amdgpu/radv_amdgpu_surface.h',
|
|
|
|
'winsys/amdgpu/radv_amdgpu_winsys.c',
|
|
|
|
'winsys/amdgpu/radv_amdgpu_winsys.h',
|
|
|
|
'winsys/amdgpu/radv_amdgpu_winsys_public.h',
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
2017-09-20 19:53:29 +01:00
|
|
|
radv_deps = []
|
2020-12-01 11:31:05 +00:00
|
|
|
radv_flags = cc.get_supported_arguments(['-Wimplicit-fallthrough', '-Wshadow'])
|
2017-09-20 19:53:29 +01:00
|
|
|
|
|
|
|
if with_platform_x11
|
|
|
|
radv_deps += dep_xcb_dri3
|
|
|
|
radv_flags += [
|
|
|
|
'-DVK_USE_PLATFORM_XCB_KHR',
|
|
|
|
'-DVK_USE_PLATFORM_XLIB_KHR',
|
|
|
|
]
|
|
|
|
libradv_files += files('radv_wsi_x11.c')
|
|
|
|
endif
|
|
|
|
|
|
|
|
if with_platform_wayland
|
|
|
|
radv_deps += dep_wayland_client
|
|
|
|
radv_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR'
|
|
|
|
libradv_files += files('radv_wsi_wayland.c')
|
|
|
|
endif
|
|
|
|
|
2020-07-11 09:17:30 +01:00
|
|
|
if system_has_kms_drm and not with_platform_android
|
2018-02-07 18:31:44 +00:00
|
|
|
radv_flags += '-DVK_USE_PLATFORM_DISPLAY_KHR'
|
|
|
|
libradv_files += files('radv_wsi_display.c')
|
|
|
|
endif
|
|
|
|
|
2018-02-09 15:45:58 +00:00
|
|
|
if with_xlib_lease
|
2020-12-21 11:11:40 +00:00
|
|
|
radv_deps += [dep_xlib_xrandr]
|
2018-02-09 15:45:58 +00:00
|
|
|
radv_flags += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'
|
|
|
|
endif
|
|
|
|
|
2019-06-19 14:03:43 +01:00
|
|
|
if with_platform_android
|
2019-06-25 10:42:03 +01:00
|
|
|
radv_deps += dep_android
|
2019-06-19 14:03:43 +01:00
|
|
|
radv_flags += [
|
|
|
|
'-DVK_USE_PLATFORM_ANDROID_KHR'
|
|
|
|
]
|
|
|
|
endif
|
|
|
|
|
2020-11-27 02:44:46 +00:00
|
|
|
if with_platform_windows
|
|
|
|
radv_flags += [
|
|
|
|
'-DVK_USE_PLATFORM_WIN32_KHR',
|
|
|
|
'-DVK_NO_PROTOTYPES',
|
|
|
|
]
|
|
|
|
endif
|
|
|
|
|
2020-08-06 09:14:07 +01:00
|
|
|
# When static linking LLVM, all its symbols are public API.
|
|
|
|
# That may cause symbol collision, so explicitly demote everything.
|
|
|
|
libvulkan_radeon_ld_args = []
|
|
|
|
libvulkan_radeon_link_depends = []
|
|
|
|
|
|
|
|
if with_llvm and with_ld_version_script
|
|
|
|
libvulkan_radeon_ld_args += ['-Wl,--version-script', join_paths(meson.current_source_dir(), 'vulkan.sym')]
|
|
|
|
libvulkan_radeon_link_depends += files('vulkan.sym')
|
|
|
|
endif
|
|
|
|
|
2017-09-20 19:53:29 +01:00
|
|
|
libvulkan_radeon = shared_library(
|
|
|
|
'vulkan_radeon',
|
2020-06-02 00:44:52 +01:00
|
|
|
[libradv_files, radv_entrypoints, radv_extensions_c, amd_vk_format_table_c, sha1_h],
|
2017-12-11 23:56:08 +00:00
|
|
|
include_directories : [
|
2019-03-05 16:21:47 +00:00
|
|
|
inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_amd, inc_amd_common, inc_amd_common_llvm, inc_compiler, inc_util, inc_vulkan_wsi,
|
2017-12-11 23:56:08 +00:00
|
|
|
],
|
|
|
|
link_with : [
|
2019-09-27 09:29:51 +01:00
|
|
|
libamd_common, libamd_common_llvm, libamdgpu_addrlib, libvulkan_wsi,
|
2017-12-11 23:56:08 +00:00
|
|
|
],
|
|
|
|
dependencies : [
|
|
|
|
dep_llvm, dep_libdrm_amdgpu, dep_thread, dep_elf, dep_dl, dep_m,
|
2019-09-17 13:35:22 +01:00
|
|
|
dep_valgrind, radv_deps, idep_aco,
|
2019-07-22 15:25:28 +01:00
|
|
|
idep_mesautil, idep_nir, idep_vulkan_util, idep_amdgfxregs_h, idep_xmlconfig,
|
2017-12-11 23:56:08 +00:00
|
|
|
],
|
2020-04-24 21:10:41 +01:00
|
|
|
c_args : [no_override_init_args, radv_flags],
|
|
|
|
cpp_args : [radv_flags],
|
2020-08-06 09:14:07 +01:00
|
|
|
link_args : [
|
|
|
|
ld_args_build_id, ld_args_bsymbolic, ld_args_gc_sections, libvulkan_radeon_ld_args,
|
|
|
|
],
|
|
|
|
link_depends : [libvulkan_radeon_link_depends,],
|
2020-04-24 21:10:41 +01:00
|
|
|
gnu_symbol_visibility : 'hidden',
|
2017-09-20 19:53:29 +01:00
|
|
|
install : true,
|
|
|
|
)
|
|
|
|
|
2019-10-29 14:21:08 +00:00
|
|
|
if with_symbols_check
|
2018-10-11 15:19:04 +01:00
|
|
|
test(
|
|
|
|
'radv symbols check',
|
|
|
|
symbols_check,
|
|
|
|
args : [
|
|
|
|
'--lib', libvulkan_radeon,
|
|
|
|
'--symbols-file', vulkan_icd_symbols,
|
2020-08-10 09:16:39 +01:00
|
|
|
'--ignore-symbol', 'ac_init_shared_llvm_once',
|
2019-10-29 21:32:05 +00:00
|
|
|
symbols_check_args,
|
2018-10-11 15:19:04 +01:00
|
|
|
],
|
|
|
|
suite : ['amd'],
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
2018-03-08 23:47:26 +00:00
|
|
|
radeon_icd = custom_target(
|
|
|
|
'radeon_icd',
|
|
|
|
input : 'radv_icd.py',
|
2017-11-09 22:55:37 +00:00
|
|
|
output : 'radeon_icd.@0@.json'.format(host_machine.cpu()),
|
2018-03-08 23:47:26 +00:00
|
|
|
command : [
|
2018-08-09 09:27:26 +01:00
|
|
|
prog_python, '@INPUT@',
|
2018-03-08 23:47:26 +00:00
|
|
|
'--lib-path', join_paths(get_option('prefix'), get_option('libdir')),
|
|
|
|
'--out', '@OUTPUT@',
|
|
|
|
],
|
|
|
|
depend_files : files('radv_extensions.py'),
|
|
|
|
build_by_default : true,
|
2017-09-20 19:53:29 +01:00
|
|
|
install_dir : with_vulkan_icd_dir,
|
2018-03-08 23:47:26 +00:00
|
|
|
install : true,
|
2017-09-20 19:53:29 +01:00
|
|
|
)
|