1
# Copyright © 2017 Intel Corporation
3
# Permission is hereby granted, free of charge, to any person obtaining a copy
4
# of this software and associated documentation files (the "Software"), to deal
5
# in the Software without restriction, including without limitation the rights
6
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
# copies of the Software, and to permit persons to whom the Software is
8
# furnished to do so, subject to the following conditions:
10
# The above copyright notice and this permission notice shall be included in
11
# all copies or substantial portions of the Software.
13
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
radv_entrypoints = custom_target(
23
input : [vk_entrypoints_gen, vk_api_xml],
24
output : ['radv_entrypoints.h', 'radv_entrypoints.c'],
26
prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',
27
'--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'radv',
28
'--device-prefix', 'sqtt', '--device-prefix', 'metro_exodus',
30
depend_files : vk_entrypoints_gen_depend_files,
33
libradv_files = files(
34
'layers/radv_metro_exodus.c',
35
'layers/radv_sqtt_layer.c',
36
'winsys/null/radv_null_bo.c',
37
'winsys/null/radv_null_bo.h',
38
'winsys/null/radv_null_cs.c',
39
'winsys/null/radv_null_cs.h',
40
'winsys/null/radv_null_winsys.c',
41
'winsys/null/radv_null_winsys_public.h',
42
'radv_acceleration_structure.c',
43
'radv_acceleration_structure.h',
50
'radv_descriptor_set.c',
51
'radv_descriptor_set.h',
59
'radv_meta_bufimage.c',
62
'radv_meta_copy_vrs_htile.c',
63
'radv_meta_dcc_retile.c',
64
'radv_meta_decompress.c',
65
'radv_meta_etc_decode.c',
66
'radv_meta_fast_clear.c',
67
'radv_meta_fmask_copy.c',
68
'radv_meta_fmask_expand.c',
69
'radv_meta_resolve.c',
70
'radv_meta_resolve_cs.c',
71
'radv_meta_resolve_fs.c',
72
'radv_nir_apply_pipeline_layout.c',
73
'radv_nir_lower_ray_queries.c',
74
'radv_nir_lower_ycbcr_textures.c',
78
'radv_pipeline_cache.c',
81
'radv_radeon_winsys.h',
83
'radv_sdma_copy_image.c',
97
files_drirc = files('00-radv-defaults.conf')
99
install_data(files_drirc, install_dir : join_paths(get_option('datadir'), 'drirc.d'))
101
if not with_platform_windows
102
libradv_files += files(
103
'winsys/amdgpu/radv_amdgpu_bo.c',
104
'winsys/amdgpu/radv_amdgpu_bo.h',
105
'winsys/amdgpu/radv_amdgpu_cs.c',
106
'winsys/amdgpu/radv_amdgpu_cs.h',
107
'winsys/amdgpu/radv_amdgpu_surface.c',
108
'winsys/amdgpu/radv_amdgpu_surface.h',
109
'winsys/amdgpu/radv_amdgpu_winsys.c',
110
'winsys/amdgpu/radv_amdgpu_winsys.h',
111
'winsys/amdgpu/radv_amdgpu_winsys_public.h',
116
libradv_files += files(
117
'radv_llvm_helper.cpp',
118
'radv_llvm_helper.h',
119
'radv_nir_to_llvm.c',
124
radv_flags = cc.get_supported_arguments(['-Wimplicit-fallthrough', '-Wshadow'])
127
radv_deps += dep_xcb_dri3
130
if with_platform_wayland
131
radv_deps += dep_wayland_client
135
radv_deps += [dep_xlib_xrandr]
138
if with_platform_android
139
radv_deps += dep_android
142
# When static linking LLVM, all its symbols are public API.
143
# That may cause symbol collision, so explicitly demote everything.
144
libvulkan_radeon_ld_args = []
145
libvulkan_radeon_link_depends = []
147
if with_ld_version_script
148
libvulkan_radeon_ld_args += ['-Wl,--version-script', join_paths(meson.current_source_dir(), 'vulkan.sym')]
149
libvulkan_radeon_link_depends += files('vulkan.sym')
152
vulkan_radv_def = 'vulkan_radv.def'
154
libvulkan_radeon = shared_library(
156
[libradv_files, radv_entrypoints, sha1_h],
157
vs_module_defs : vulkan_radv_def,
158
include_directories : [
159
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,
162
libamd_common, libamd_common_llvm, libamdgpu_addrlib,
165
dep_llvm, dep_libdrm_amdgpu, dep_thread, dep_elf, dep_dl, dep_m,
166
dep_valgrind, radv_deps, idep_aco,
167
idep_mesautil, idep_nir, idep_vulkan_util, idep_vulkan_wsi,
168
idep_vulkan_runtime, idep_amdgfxregs_h, idep_xmlconfig,
169
idep_vulkan_common_entrypoints_h
171
c_args : [no_override_init_args, radv_flags, c_msvc_compat_args],
172
cpp_args : [radv_flags, cpp_msvc_compat_args],
174
ld_args_build_id, ld_args_bsymbolic, ld_args_gc_sections, libvulkan_radeon_ld_args,
176
link_depends : [libvulkan_radeon_link_depends,],
177
gnu_symbol_visibility : 'hidden',
181
if with_symbols_check
183
'radv symbols check',
186
'--lib', libvulkan_radeon,
187
'--symbols-file', vulkan_icd_symbols,
188
'--ignore-symbol', 'ac_init_shared_llvm_once',
195
icd_lib_path = join_paths(get_option('prefix'), get_option('libdir'))
196
icd_file_name = 'libvulkan_radeon.so'
197
if with_platform_windows
199
icd_file_name = 'vulkan_radeon.dll'
203
prog_python, '@INPUT0@',
204
'--api-version', '1.3', '--xml', '@INPUT1@',
205
'--lib-path', join_paths(icd_lib_path, icd_file_name),
208
if with_platform_windows
209
icd_command += '--use-backslash'
212
radeon_icd = custom_target(
214
input : [vk_icd_gen, vk_api_xml],
215
output : 'radeon_icd.@0@.json'.format(host_machine.cpu()),
216
command : icd_command,
217
build_by_default : true,
218
install_dir : with_vulkan_icd_dir,
222
if meson.version().version_compare('>= 0.58')
223
_dev_icdname = 'radeon_devenv_icd.@0@.json'.format(host_machine.cpu())
226
input : [vk_icd_gen, vk_api_xml],
227
output : _dev_icdname,
229
prog_python, '@INPUT0@',
230
'--api-version', '1.3', '--xml', '@INPUT1@',
231
'--lib-path', meson.current_build_dir() / icd_file_name,
234
build_by_default : true,
237
devenv.append('VK_ICD_FILENAMES', meson.current_build_dir() / _dev_icdname)