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',
|
2021-11-24 17:22:23 +00:00
|
|
|
'--device-prefix', 'sqtt', '--device-prefix', 'metro_exodus',
|
2017-12-11 23:56:08 +00:00
|
|
|
],
|
2021-03-29 20:39:07 +01:00
|
|
|
depend_files : vk_entrypoints_gen_depend_files,
|
2017-09-20 19:53:29 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
libradv_files = files(
|
2021-11-24 17:22:23 +00:00
|
|
|
'layers/radv_metro_exodus.c',
|
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',
|
2021-01-18 11:11:19 +00:00
|
|
|
'radv_acceleration_structure.c',
|
2021-08-11 01:24:01 +01:00
|
|
|
'radv_acceleration_structure.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',
|
2022-02-07 02:28:01 +00:00
|
|
|
'radv_device_generated_commands.c',
|
2017-09-20 19:53:29 +01:00
|
|
|
'radv_formats.c',
|
|
|
|
'radv_image.c',
|
|
|
|
'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',
|
2020-12-08 14:36:22 +00:00
|
|
|
'radv_meta_copy_vrs_htile.c',
|
2020-08-05 10:54:36 +01:00
|
|
|
'radv_meta_dcc_retile.c',
|
2017-09-20 19:53:29 +01:00
|
|
|
'radv_meta_decompress.c',
|
2021-11-03 23:49:45 +00:00
|
|
|
'radv_meta_etc_decode.c',
|
2017-09-20 19:53:29 +01:00
|
|
|
'radv_meta_fast_clear.c',
|
2021-08-20 15:19:40 +01:00
|
|
|
'radv_meta_fmask_copy.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',
|
radv,aco: lower vulkan_resource_index in NIR
fossil-db (Sienna Cichlid):
Totals from 31338 (19.31% of 162293) affected shaders:
MaxWaves: 758634 -> 758616 (-0.00%)
Instrs: 26398289 -> 26378282 (-0.08%); split: -0.09%, +0.01%
CodeSize: 141048208 -> 140971060 (-0.05%); split: -0.07%, +0.01%
VGPRs: 1373656 -> 1373736 (+0.01%)
SpillSGPRs: 9944 -> 9924 (-0.20%); split: -0.24%, +0.04%
SpillVGPRs: 1892 -> 1898 (+0.32%); split: -0.95%, +1.27%
Latency: 308570144 -> 308528462 (-0.01%); split: -0.03%, +0.02%
InvThroughput: 57698072 -> 57684901 (-0.02%); split: -0.07%, +0.04%
VClause: 440357 -> 440602 (+0.06%); split: -0.02%, +0.08%
SClause: 974724 -> 973315 (-0.14%); split: -0.18%, +0.04%
Copies: 1944925 -> 1945103 (+0.01%); split: -0.11%, +0.12%
Branches: 799444 -> 799461 (+0.00%); split: -0.00%, +0.00%
PreSGPRs: 1619860 -> 1619233 (-0.04%); split: -0.05%, +0.02%
PreVGPRs: 1252813 -> 1252863 (+0.00%); split: -0.00%, +0.00%
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12773>
2021-08-04 12:59:26 +01:00
|
|
|
'radv_nir_apply_pipeline_layout.c',
|
2022-03-16 11:39:47 +00:00
|
|
|
'radv_nir_lower_abi.c',
|
2022-01-14 22:08:27 +00:00
|
|
|
'radv_nir_lower_ray_queries.c',
|
2019-03-21 00:29:52 +00:00
|
|
|
'radv_nir_lower_ycbcr_textures.c',
|
2017-09-20 19:53:29 +01:00
|
|
|
'radv_pass.c',
|
2021-05-31 17:38:13 +01:00
|
|
|
'radv_perfcounter.c',
|
2017-09-20 19:53:29 +01:00
|
|
|
'radv_pipeline.c',
|
|
|
|
'radv_pipeline_cache.c',
|
2021-08-24 01:36:21 +01:00
|
|
|
'radv_pipeline_rt.c',
|
2017-09-20 19:53:29 +01:00
|
|
|
'radv_private.h',
|
|
|
|
'radv_radeon_winsys.h',
|
2022-01-14 22:02:37 +00:00
|
|
|
'radv_rt_common.c',
|
2021-11-25 09:12:56 +00:00
|
|
|
'radv_sdma_copy_image.c',
|
2017-09-20 19:53:29 +01:00
|
|
|
'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-03-13 13:49:11 +00:00
|
|
|
'radv_shader_info.c',
|
2021-06-04 15:58:33 +01:00
|
|
|
'radv_spm.c',
|
2020-02-18 07:32:33 +00:00
|
|
|
'radv_sqtt.c',
|
2017-09-20 19:53:29 +01:00
|
|
|
'radv_query.c',
|
|
|
|
'radv_wsi.c',
|
|
|
|
'si_cmd_buffer.c',
|
|
|
|
'vk_format.h',
|
|
|
|
)
|
|
|
|
|
2022-02-24 09:13:51 +00:00
|
|
|
files_drirc = files('00-radv-defaults.conf')
|
|
|
|
|
|
|
|
install_data(files_drirc, install_dir : join_paths(get_option('datadir'), 'drirc.d'))
|
|
|
|
|
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
|
|
|
|
|
2021-06-29 11:56:37 +01:00
|
|
|
if with_llvm
|
|
|
|
libradv_files += files(
|
|
|
|
'radv_llvm_helper.cpp',
|
|
|
|
'radv_llvm_helper.h',
|
|
|
|
'radv_nir_to_llvm.c',
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
2022-04-07 14:39:52 +01:00
|
|
|
subdir('radix_sort')
|
|
|
|
libradv_files += radix_sort_files
|
|
|
|
|
2017-09-20 19:53:29 +01:00
|
|
|
radv_deps = []
|
2021-06-25 16:39:10 +01: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
|
|
|
|
endif
|
|
|
|
|
|
|
|
if with_platform_wayland
|
|
|
|
radv_deps += dep_wayland_client
|
|
|
|
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
|
|
|
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
|
2020-11-27 02:44:46 +00:00
|
|
|
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 = []
|
|
|
|
|
2021-10-03 23:11:36 +01:00
|
|
|
if with_ld_version_script
|
2020-08-06 09:14:07 +01:00
|
|
|
libvulkan_radeon_ld_args += ['-Wl,--version-script', join_paths(meson.current_source_dir(), 'vulkan.sym')]
|
|
|
|
libvulkan_radeon_link_depends += files('vulkan.sym')
|
|
|
|
endif
|
|
|
|
|
2022-07-08 17:18:13 +01:00
|
|
|
radv_build_id = get_option('radv-build-id')
|
|
|
|
if radv_build_id != ''
|
|
|
|
radv_flags += '-DRADV_BUILD_ID_OVERRIDE="' + radv_build_id + '"'
|
|
|
|
endif
|
|
|
|
|
2017-09-20 19:53:29 +01:00
|
|
|
libvulkan_radeon = shared_library(
|
|
|
|
'vulkan_radeon',
|
2022-04-07 14:39:52 +01:00
|
|
|
[libradv_files, radv_entrypoints, sha1_h, radix_sort_spv],
|
2021-12-03 12:51:58 +00:00
|
|
|
vs_module_defs : vulkan_api_def,
|
2017-12-11 23:56:08 +00:00
|
|
|
include_directories : [
|
2021-10-06 15:32:17 +01: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,
|
2017-12-11 23:56:08 +00:00
|
|
|
],
|
|
|
|
link_with : [
|
2021-10-06 15:32:17 +01:00
|
|
|
libamd_common, libamd_common_llvm, libamdgpu_addrlib,
|
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,
|
2021-10-06 15:32:17 +01:00
|
|
|
idep_mesautil, idep_nir, idep_vulkan_util, idep_vulkan_wsi,
|
2021-10-01 22:45:44 +01:00
|
|
|
idep_vulkan_runtime, idep_amdgfxregs_h, idep_xmlconfig,
|
2022-01-06 20:57:28 +00:00
|
|
|
idep_vulkan_common_entrypoints_h
|
2017-12-11 23:56:08 +00:00
|
|
|
],
|
2021-06-25 16:39:10 +01:00
|
|
|
c_args : [no_override_init_args, radv_flags, c_msvc_compat_args],
|
|
|
|
cpp_args : [radv_flags, cpp_msvc_compat_args],
|
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
|
|
|
|
|
2021-02-08 02:38:58 +00:00
|
|
|
icd_lib_path = join_paths(get_option('prefix'), get_option('libdir'))
|
|
|
|
icd_file_name = 'libvulkan_radeon.so'
|
|
|
|
if with_platform_windows
|
|
|
|
icd_lib_path = '.'
|
|
|
|
icd_file_name = 'vulkan_radeon.dll'
|
|
|
|
endif
|
|
|
|
|
2021-10-20 22:42:32 +01:00
|
|
|
icd_command = [
|
|
|
|
prog_python, '@INPUT0@',
|
2021-10-04 15:47:58 +01:00
|
|
|
'--api-version', '1.3', '--xml', '@INPUT1@',
|
2021-10-20 22:42:32 +01:00
|
|
|
'--lib-path', join_paths(icd_lib_path, icd_file_name),
|
|
|
|
'--out', '@OUTPUT@',
|
|
|
|
]
|
|
|
|
if with_platform_windows
|
|
|
|
icd_command += '--use-backslash'
|
|
|
|
endif
|
|
|
|
|
2018-03-08 23:47:26 +00:00
|
|
|
radeon_icd = custom_target(
|
|
|
|
'radeon_icd',
|
2021-02-07 14:25:14 +00:00
|
|
|
input : [vk_icd_gen, vk_api_xml],
|
2017-11-09 22:55:37 +00:00
|
|
|
output : 'radeon_icd.@0@.json'.format(host_machine.cpu()),
|
2021-10-20 22:42:32 +01:00
|
|
|
command : icd_command,
|
2018-03-08 23:47:26 +00:00
|
|
|
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
|
|
|
)
|
2021-02-07 14:25:14 +00:00
|
|
|
|
2022-02-04 18:47:17 +00:00
|
|
|
if meson.version().version_compare('>= 0.58')
|
|
|
|
_dev_icdname = 'radeon_devenv_icd.@0@.json'.format(host_machine.cpu())
|
|
|
|
custom_target(
|
|
|
|
'radeon_devenv_icd',
|
|
|
|
input : [vk_icd_gen, vk_api_xml],
|
|
|
|
output : _dev_icdname,
|
|
|
|
command : [
|
|
|
|
prog_python, '@INPUT0@',
|
|
|
|
'--api-version', '1.3', '--xml', '@INPUT1@',
|
|
|
|
'--lib-path', meson.current_build_dir() / icd_file_name,
|
|
|
|
'--out', '@OUTPUT@',
|
|
|
|
],
|
|
|
|
build_by_default : true,
|
|
|
|
)
|
|
|
|
|
|
|
|
devenv.append('VK_ICD_FILENAMES', meson.current_build_dir() / _dev_icdname)
|
|
|
|
endif
|