Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mesa
Path: blob/21.2-virgl/src/intel/vulkan/meson.build
4547 views
1
# Copyright © 2017-2019 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
anv_entrypoints = custom_target(
22
'anv_entrypoints',
23
input : [vk_entrypoints_gen, vk_api_xml],
24
output : ['anv_entrypoints.h', 'anv_entrypoints.c'],
25
command : [
26
prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',
27
'--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'anv',
28
'--device-prefix', 'gfx7', '--device-prefix', 'gfx75',
29
'--device-prefix', 'gfx8', '--device-prefix', 'gfx9',
30
'--device-prefix', 'gfx11', '--device-prefix', 'gfx12',
31
'--device-prefix', 'gfx125',
32
],
33
depend_files : vk_entrypoints_gen_depend_files,
34
)
35
36
intel_icd = custom_target(
37
'intel_icd',
38
input : [vk_icd_gen, vk_api_xml],
39
output : 'intel_icd.@[email protected]'.format(host_machine.cpu()),
40
command : [
41
prog_python, '@INPUT0@',
42
'--api-version', '1.2', '--xml', '@INPUT1@',
43
'--lib-path', join_paths(get_option('prefix'), get_option('libdir'),
44
'libvulkan_intel.so'),
45
'--out', '@OUTPUT@',
46
],
47
build_by_default : true,
48
install_dir : with_vulkan_icd_dir,
49
install : true,
50
)
51
52
libanv_per_hw_ver_libs = []
53
anv_per_hw_ver_files = files(
54
'genX_blorp_exec.c',
55
'genX_cmd_buffer.c',
56
'genX_gpu_memcpy.c',
57
'genX_pipeline.c',
58
'genX_query.c',
59
'genX_state.c',
60
)
61
foreach g : [['70', ['gfx7_cmd_buffer.c']], ['75', ['gfx7_cmd_buffer.c']],
62
['80', ['gfx8_cmd_buffer.c']], ['90', ['gfx8_cmd_buffer.c']],
63
['110', ['gfx8_cmd_buffer.c']], ['120', ['gfx8_cmd_buffer.c']],
64
['125', ['gfx8_cmd_buffer.c']]]
65
_gfx_ver = g[0]
66
libanv_per_hw_ver_libs += static_library(
67
'anv_per_hw_ver@0@'.format(_gfx_ver),
68
[anv_per_hw_ver_files, g[1], anv_entrypoints[0]],
69
include_directories : [
70
inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_compiler, inc_intel, inc_vulkan_wsi,
71
],
72
c_args : [
73
no_override_init_args, c_sse2_args,
74
'-DGFX_VERx10=@0@'.format(_gfx_ver),
75
],
76
gnu_symbol_visibility : 'hidden',
77
dependencies : [
78
dep_libdrm, dep_valgrind, idep_nir_headers, idep_genxml, idep_vulkan_util_headers,
79
],
80
)
81
endforeach
82
83
libanv_files = files(
84
'anv_acceleration_structure.c',
85
'anv_allocator.c',
86
'anv_android.h',
87
'anv_batch_chain.c',
88
'anv_blorp.c',
89
'anv_cmd_buffer.c',
90
'anv_descriptor_set.c',
91
'anv_device.c',
92
'anv_formats.c',
93
'anv_genX.h',
94
'anv_image.c',
95
'anv_measure.c',
96
'anv_measure.h',
97
'anv_nir.h',
98
'anv_nir_add_base_work_group_id.c',
99
'anv_nir_apply_pipeline_layout.c',
100
'anv_nir_compute_push_layout.c',
101
'anv_nir_lower_multiview.c',
102
'anv_nir_lower_ubo_loads.c',
103
'anv_nir_lower_ycbcr_textures.c',
104
'anv_pass.c',
105
'anv_perf.c',
106
'anv_pipeline.c',
107
'anv_pipeline_cache.c',
108
'anv_private.h',
109
'anv_queue.c',
110
'anv_util.c',
111
'anv_wsi.c',
112
)
113
114
anv_deps = [
115
dep_libdrm,
116
dep_valgrind,
117
idep_genxml,
118
idep_nir_headers,
119
idep_vulkan_util_headers,
120
]
121
anv_flags = [
122
no_override_init_args,
123
c_sse2_args,
124
]
125
126
if with_platform_x11
127
anv_deps += dep_xcb_dri3
128
anv_flags += [
129
'-DVK_USE_PLATFORM_XCB_KHR',
130
'-DVK_USE_PLATFORM_XLIB_KHR',
131
]
132
libanv_files += files('anv_wsi_x11.c')
133
endif
134
135
if with_platform_wayland
136
anv_deps += dep_wayland_client
137
anv_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR'
138
libanv_files += files('anv_wsi_wayland.c')
139
endif
140
141
if system_has_kms_drm and not with_platform_android
142
anv_flags += '-DVK_USE_PLATFORM_DISPLAY_KHR'
143
libanv_files += files('anv_wsi_display.c')
144
endif
145
146
if with_xlib_lease
147
anv_deps += [dep_xlib_xrandr]
148
anv_flags += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'
149
endif
150
151
if with_platform_android
152
anv_flags += '-DVK_USE_PLATFORM_ANDROID_KHR'
153
libanv_files += files('anv_android.c')
154
else
155
libanv_files += files('anv_android_stubs.c')
156
endif
157
158
libanv_common = static_library(
159
'anv_common',
160
[
161
libanv_files, anv_entrypoints, sha1_h,
162
gen_xml_pack,
163
],
164
include_directories : [
165
inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_intel, inc_compiler,
166
inc_vulkan_wsi, inc_util,
167
],
168
c_args : anv_flags,
169
gnu_symbol_visibility : 'hidden',
170
dependencies : anv_deps,
171
)
172
173
libvulkan_intel = shared_library(
174
'vulkan_intel',
175
[files('anv_gem.c'), anv_entrypoints[0]],
176
include_directories : [
177
inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_intel, inc_compiler, inc_vulkan_wsi,
178
],
179
link_whole : [libanv_common, libanv_per_hw_ver_libs],
180
link_with : [
181
libintel_compiler, libintel_dev, libisl, libblorp, libvulkan_wsi,
182
libintel_perf,
183
],
184
dependencies : [
185
dep_thread, dep_dl, dep_m, anv_deps, idep_libintel_common,
186
idep_nir, idep_genxml, idep_vulkan_util, idep_mesautil, idep_xmlconfig,
187
],
188
c_args : anv_flags,
189
gnu_symbol_visibility : 'hidden',
190
link_args : [ld_args_build_id, ld_args_bsymbolic, ld_args_gc_sections],
191
install : true,
192
)
193
194
if with_symbols_check
195
test(
196
'anv symbols check',
197
symbols_check,
198
args : [
199
'--lib', libvulkan_intel,
200
'--symbols-file', vulkan_icd_symbols,
201
symbols_check_args,
202
],
203
suite : ['intel'],
204
)
205
endif
206
207
if with_tests
208
libvulkan_intel_test = static_library(
209
'vulkan_intel_test',
210
[files('anv_gem_stubs.c'), anv_entrypoints[0]],
211
include_directories : [
212
inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_intel, inc_compiler, inc_vulkan_wsi,
213
],
214
link_whole : libanv_common,
215
link_with : [
216
libanv_per_hw_ver_libs, libintel_compiler, libintel_common, libintel_dev,
217
libisl, libblorp, libvulkan_wsi, libintel_perf,
218
],
219
dependencies : [
220
dep_thread, dep_dl, dep_m, anv_deps,
221
idep_nir, idep_vulkan_util, idep_mesautil,
222
],
223
c_args : anv_flags,
224
gnu_symbol_visibility : 'hidden',
225
)
226
227
foreach t : ['block_pool_no_free', 'block_pool_grow_first',
228
'state_pool_no_free', 'state_pool_free_list_only',
229
'state_pool', 'state_pool_padding']
230
test(
231
'anv_@0@'.format(t),
232
executable(
233
t,
234
['tests/@[email protected]'.format(t), anv_entrypoints[0]],
235
c_args : [ c_sse2_args ],
236
link_with : libvulkan_intel_test,
237
dependencies : [dep_libdrm, dep_thread, dep_m, dep_valgrind, idep_vulkan_util, ],
238
include_directories : [
239
inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_intel, inc_compiler, inc_vulkan_wsi,
240
],
241
),
242
suite : ['intel'],
243
)
244
endforeach
245
endif
246
247