Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mesa
Path: blob/21.2-virgl/src/broadcom/vulkan/meson.build
4560 views
1
# Copyright © 2019 Raspberry Pi
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
v3dv_entrypoints = custom_target(
22
'v3dv_entrypoints',
23
input : [vk_entrypoints_gen, vk_api_xml],
24
output : ['v3dv_entrypoints.h', 'v3dv_entrypoints.c'],
25
command : [
26
prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',
27
'--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'v3dv',
28
'--device-prefix', 'ver42',
29
],
30
depend_files : vk_entrypoints_gen_depend_files,
31
)
32
33
libv3dv_files = files(
34
'v3dv_bo.c',
35
'v3dv_cl.c',
36
'v3dv_cmd_buffer.c',
37
'v3dv_debug.c',
38
'v3dv_debug.h',
39
'v3dv_descriptor_set.c',
40
'v3dv_device.c',
41
'v3dv_formats.c',
42
'v3dv_image.c',
43
'v3dv_limits.h',
44
'v3dv_meta_clear.c',
45
'v3dv_meta_copy.c',
46
'v3dv_pass.c',
47
'v3dv_pipeline.c',
48
'v3dv_pipeline_cache.c',
49
'v3dv_private.h',
50
'v3dv_query.c',
51
'v3dv_queue.c',
52
'v3dv_uniforms.c',
53
'v3dv_util.c',
54
'v3dv_wsi.c',
55
)
56
57
files_per_version = files(
58
'v3dvx_cmd_buffer.c',
59
'v3dvx_descriptor_set.c',
60
'v3dvx_device.c',
61
'v3dvx_formats.c',
62
'v3dvx_image.c',
63
'v3dvx_pipeline.c',
64
'v3dvx_meta_clear.c',
65
'v3dvx_meta_copy.c',
66
'v3dvx_pipeline.c',
67
'v3dvx_queue.c',
68
)
69
70
# The vulkan driver only supports version >= 42, which is the version present in
71
# Rpi4. We need to explicitly set it as we are reusing pieces from the GL v3d
72
# driver.
73
v3d_versions = ['42']
74
75
v3dv_flags = []
76
77
dep_v3dv3 = dependency('v3dv3', required : false)
78
if dep_v3dv3.found()
79
v3dv_flags += '-DUSE_V3D_SIMULATOR'
80
endif
81
82
v3dv_deps = [
83
dep_dl,
84
dep_libdrm,
85
dep_valgrind,
86
dep_v3dv3,
87
idep_nir,
88
idep_nir_headers,
89
idep_vulkan_util,
90
]
91
92
if with_platform_x11
93
v3dv_deps += dep_xcb_dri3
94
v3dv_flags += [
95
'-DVK_USE_PLATFORM_XCB_KHR',
96
'-DVK_USE_PLATFORM_XLIB_KHR',
97
]
98
libv3dv_files += files('v3dv_wsi_x11.c')
99
endif
100
101
if with_platform_wayland
102
v3dv_deps += [dep_wayland_client, dep_wl_protocols]
103
v3dv_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR'
104
libv3dv_files += files('v3dv_wsi_wayland.c')
105
libv3dv_files += [wayland_drm_client_protocol_h, wayland_drm_protocol_c]
106
endif
107
108
if system_has_kms_drm and not with_platform_android
109
v3dv_flags += '-DVK_USE_PLATFORM_DISPLAY_KHR'
110
libv3dv_files += files('v3dv_wsi_display.c')
111
endif
112
113
per_version_libs = []
114
foreach ver : v3d_versions
115
per_version_libs += static_library(
116
'v3dv-v' + ver,
117
[files_per_version, v3d_xml_pack, v3dv_entrypoints[0]],
118
include_directories : [
119
inc_src, inc_include, inc_gallium, inc_gallium_aux, inc_broadcom,
120
inc_compiler, inc_util, inc_vulkan_wsi,
121
],
122
c_args : [v3dv_flags, '-DV3D_VERSION=' + ver],
123
gnu_symbol_visibility : 'hidden',
124
dependencies : [v3dv_deps],
125
)
126
endforeach
127
128
libvulkan_broadcom = shared_library(
129
'vulkan_broadcom',
130
[libv3dv_files, v3dv_entrypoints, sha1_h],
131
include_directories : [
132
inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_broadcom, inc_compiler, inc_util, inc_vulkan_wsi,
133
],
134
link_with : [
135
libbroadcom_cle,
136
libbroadcom_v3d,
137
libvulkan_wsi,
138
per_version_libs,
139
],
140
dependencies : v3dv_deps,
141
c_args : v3dv_flags,
142
link_args : ['-Wl,--build-id=sha1', ld_args_bsymbolic, ld_args_gc_sections],
143
gnu_symbol_visibility : 'hidden',
144
install : true,
145
)
146
147
if with_symbols_check
148
test(
149
'v3dv symbols check',
150
symbols_check,
151
args : [
152
'--lib', libvulkan_broadcom,
153
'--symbols-file', vulkan_icd_symbols,
154
symbols_check_args,
155
],
156
suite : ['broadcom'],
157
)
158
endif
159
160
broadcom_icd = custom_target(
161
'broadcom_icd',
162
input : [vk_icd_gen, vk_api_xml],
163
output : 'broadcom_icd.@[email protected]'.format(host_machine.cpu()),
164
command : [
165
prog_python, '@INPUT0@',
166
'--api-version', '1.0', '--xml', '@INPUT1@',
167
'--lib-path', join_paths(get_option('prefix'), get_option('libdir'),
168
'libvulkan_broadcom.so'),
169
'--out', '@OUTPUT@',
170
],
171
build_by_default : true,
172
install_dir : with_vulkan_icd_dir,
173
install : true,
174
)
175
176