Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mesa
Path: blob/21.2-virgl/src/amd/vulkan/meson.build
7130 views
1
# Copyright © 2017 Intel Corporation
2
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:
9
10
# The above copyright notice and this permission notice shall be included in
11
# all copies or substantial portions of the Software.
12
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
19
# SOFTWARE.
20
21
radv_entrypoints = custom_target(
22
'radv_entrypoints',
23
input : [vk_entrypoints_gen, vk_api_xml],
24
output : ['radv_entrypoints.h', 'radv_entrypoints.c'],
25
command : [
26
prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',
27
'--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'radv',
28
'--device-prefix', 'sqtt',
29
],
30
depend_files : vk_entrypoints_gen_depend_files,
31
)
32
33
libradv_files = files(
34
'layers/radv_sqtt_layer.c',
35
'winsys/null/radv_null_bo.c',
36
'winsys/null/radv_null_bo.h',
37
'winsys/null/radv_null_cs.c',
38
'winsys/null/radv_null_cs.h',
39
'winsys/null/radv_null_winsys.c',
40
'winsys/null/radv_null_winsys_public.h',
41
'radv_acceleration_structure.c',
42
'radv_android.c',
43
'radv_cmd_buffer.c',
44
'radv_cs.h',
45
'radv_debug.c',
46
'radv_debug.h',
47
'radv_device.c',
48
'radv_descriptor_set.c',
49
'radv_descriptor_set.h',
50
'radv_formats.c',
51
'radv_image.c',
52
'radv_llvm_helper.cpp',
53
'radv_meta.c',
54
'radv_meta.h',
55
'radv_meta_blit.c',
56
'radv_meta_blit2d.c',
57
'radv_meta_buffer.c',
58
'radv_meta_bufimage.c',
59
'radv_meta_clear.c',
60
'radv_meta_copy.c',
61
'radv_meta_copy_vrs_htile.c',
62
'radv_meta_dcc_retile.c',
63
'radv_meta_decompress.c',
64
'radv_meta_fast_clear.c',
65
'radv_meta_fmask_expand.c',
66
'radv_meta_resolve.c',
67
'radv_meta_resolve_cs.c',
68
'radv_meta_resolve_fs.c',
69
'radv_nir_lower_ycbcr_textures.c',
70
'radv_nir_to_llvm.c',
71
'radv_pass.c',
72
'radv_pipeline.c',
73
'radv_pipeline_cache.c',
74
'radv_private.h',
75
'radv_radeon_winsys.h',
76
'radv_shader.c',
77
'radv_shader.h',
78
'radv_shader_args.c',
79
'radv_shader_args.h',
80
'radv_shader_helper.h',
81
'radv_shader_info.c',
82
'radv_sqtt.c',
83
'radv_query.c',
84
'radv_util.c',
85
'radv_wsi.c',
86
'si_cmd_buffer.c',
87
'vk_format.h',
88
)
89
90
if not with_platform_windows
91
libradv_files += files(
92
'winsys/amdgpu/radv_amdgpu_bo.c',
93
'winsys/amdgpu/radv_amdgpu_bo.h',
94
'winsys/amdgpu/radv_amdgpu_cs.c',
95
'winsys/amdgpu/radv_amdgpu_cs.h',
96
'winsys/amdgpu/radv_amdgpu_surface.c',
97
'winsys/amdgpu/radv_amdgpu_surface.h',
98
'winsys/amdgpu/radv_amdgpu_winsys.c',
99
'winsys/amdgpu/radv_amdgpu_winsys.h',
100
'winsys/amdgpu/radv_amdgpu_winsys_public.h',
101
)
102
endif
103
104
radv_deps = []
105
radv_flags = cc.get_supported_arguments(['-Wimplicit-fallthrough', '-Wshadow', '-Wpointer-arith'])
106
107
if with_platform_x11
108
radv_deps += dep_xcb_dri3
109
radv_flags += [
110
'-DVK_USE_PLATFORM_XCB_KHR',
111
'-DVK_USE_PLATFORM_XLIB_KHR',
112
]
113
libradv_files += files('radv_wsi_x11.c')
114
endif
115
116
if with_platform_wayland
117
radv_deps += dep_wayland_client
118
radv_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR'
119
libradv_files += files('radv_wsi_wayland.c')
120
endif
121
122
if system_has_kms_drm and not with_platform_android
123
radv_flags += '-DVK_USE_PLATFORM_DISPLAY_KHR'
124
libradv_files += files('radv_wsi_display.c')
125
endif
126
127
if with_xlib_lease
128
radv_deps += [dep_xlib_xrandr]
129
radv_flags += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'
130
endif
131
132
if with_platform_android
133
radv_deps += dep_android
134
radv_flags += [
135
'-DVK_USE_PLATFORM_ANDROID_KHR'
136
]
137
endif
138
139
if with_platform_windows
140
radv_flags += [
141
'-DVK_USE_PLATFORM_WIN32_KHR',
142
]
143
endif
144
145
# When static linking LLVM, all its symbols are public API.
146
# That may cause symbol collision, so explicitly demote everything.
147
libvulkan_radeon_ld_args = []
148
libvulkan_radeon_link_depends = []
149
150
if with_llvm and with_ld_version_script
151
libvulkan_radeon_ld_args += ['-Wl,--version-script', join_paths(meson.current_source_dir(), 'vulkan.sym')]
152
libvulkan_radeon_link_depends += files('vulkan.sym')
153
endif
154
155
vulkan_radv_def = 'vulkan_radv.def'
156
157
libvulkan_radeon = shared_library(
158
'vulkan_radeon',
159
[libradv_files, radv_entrypoints, sha1_h],
160
vs_module_defs : vulkan_radv_def,
161
include_directories : [
162
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,
163
],
164
link_with : [
165
libamd_common, libamd_common_llvm, libamdgpu_addrlib, libvulkan_wsi,
166
],
167
dependencies : [
168
dep_llvm, dep_libdrm_amdgpu, dep_thread, dep_elf, dep_dl, dep_m,
169
dep_valgrind, radv_deps, idep_aco,
170
idep_mesautil, idep_nir, idep_vulkan_util, idep_amdgfxregs_h, idep_xmlconfig,
171
],
172
c_args : [no_override_init_args, radv_flags],
173
cpp_args : [radv_flags],
174
link_args : [
175
ld_args_build_id, ld_args_bsymbolic, ld_args_gc_sections, libvulkan_radeon_ld_args,
176
],
177
link_depends : [libvulkan_radeon_link_depends,],
178
gnu_symbol_visibility : 'hidden',
179
install : true,
180
)
181
182
if with_symbols_check
183
test(
184
'radv symbols check',
185
symbols_check,
186
args : [
187
'--lib', libvulkan_radeon,
188
'--symbols-file', vulkan_icd_symbols,
189
'--ignore-symbol', 'ac_init_shared_llvm_once',
190
symbols_check_args,
191
],
192
suite : ['amd'],
193
)
194
endif
195
196
icd_lib_path = join_paths(get_option('prefix'), get_option('libdir'))
197
icd_file_name = 'libvulkan_radeon.so'
198
if with_platform_windows
199
icd_lib_path = '.'
200
icd_file_name = 'vulkan_radeon.dll'
201
endif
202
203
radeon_icd = custom_target(
204
'radeon_icd',
205
input : [vk_icd_gen, vk_api_xml],
206
output : 'radeon_icd.@[email protected]'.format(host_machine.cpu()),
207
command : [
208
prog_python, '@INPUT0@',
209
'--api-version', '1.2', '--xml', '@INPUT1@',
210
'--lib-path', join_paths(icd_lib_path, icd_file_name),
211
'--out', '@OUTPUT@',
212
],
213
build_by_default : true,
214
install_dir : with_vulkan_icd_dir,
215
install : true,
216
)
217
218
219