1 # Copyright © 2017-2019 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 anv_extensions_py = files('anv_extensions.py')
23 anv_entrypoints = custom_target(
24 'anv_entrypoints.[ch]',
25 input : ['anv_entrypoints_gen.py', vk_api_xml],
26 output : ['anv_entrypoints.h', 'anv_entrypoints.c'],
28 prog_python, '@INPUT0@', '--xml', '@INPUT1@',
29 '--outdir', meson.current_build_dir(),
31 depend_files : anv_extensions_py,
34 anv_extensions_c = custom_target(
36 input : ['anv_extensions_gen.py', vk_api_xml],
37 output : 'anv_extensions.c',
39 prog_python, '@INPUT0@', '--xml', '@INPUT1@',
40 '--out-c', '@OUTPUT@',
42 depend_files : anv_extensions_py,
45 anv_extensions_h = custom_target(
47 input : ['anv_extensions_gen.py', vk_api_xml],
48 output : 'anv_extensions.h',
50 prog_python, '@INPUT0@', '--xml', '@INPUT1@',
51 '--out-h', '@OUTPUT@',
53 depend_files : anv_extensions_py,
56 intel_icd = custom_target(
59 output : 'intel_icd.@0@.json'.format(host_machine.cpu()),
61 prog_python, '@INPUT@',
62 '--lib-path', join_paths(get_option('prefix'), get_option('libdir')),
65 depend_files : anv_extensions_py,
66 build_by_default : true,
67 install_dir : with_vulkan_icd_dir,
72 anv_gen_files = files(
80 foreach g : [['70', ['gen7_cmd_buffer.c']], ['75', ['gen7_cmd_buffer.c']],
81 ['80', ['gen8_cmd_buffer.c']], ['90', ['gen8_cmd_buffer.c']],
82 ['100', ['gen8_cmd_buffer.c']], ['110', ['gen8_cmd_buffer.c']],
83 ['120', ['gen8_cmd_buffer.c']]]
85 libanv_gen_libs += static_library(
86 'anv_gen@0@'.format(_gen),
87 [anv_gen_files, g[1], anv_entrypoints[0], anv_extensions_h],
88 include_directories : [
89 inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_compiler, inc_intel, inc_vulkan_wsi,
92 c_vis_args, no_override_init_args, c_sse2_args,
93 '-DGEN_VERSIONx10=@0@'.format(_gen),
96 dep_libdrm, dep_valgrind, idep_nir_headers, idep_genxml, idep_vulkan_util_headers,
101 libanv_files = files(
107 'anv_descriptor_set.c',
115 'anv_nir_add_base_work_group_id.c',
116 'anv_nir_apply_pipeline_layout.c',
117 'anv_nir_compute_push_layout.c',
118 'anv_nir_lower_multiview.c',
119 'anv_nir_lower_ycbcr_textures.c',
123 'anv_pipeline_cache.c',
135 idep_vulkan_util_headers,
136 idep_xmlconfig_headers,
140 no_override_init_args,
145 anv_deps += dep_xcb_dri3
147 '-DVK_USE_PLATFORM_XCB_KHR',
148 '-DVK_USE_PLATFORM_XLIB_KHR',
150 libanv_files += files('anv_wsi_x11.c')
153 if with_platform_wayland
154 anv_deps += dep_wayland_client
155 anv_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR'
156 libanv_files += files('anv_wsi_wayland.c')
160 anv_flags += '-DVK_USE_PLATFORM_DISPLAY_KHR'
161 libanv_files += files('anv_wsi_display.c')
165 anv_deps += [dep_xcb_xrandr, dep_xlib_xrandr]
166 anv_flags += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'
169 if with_platform_android
170 anv_flags += '-DVK_USE_PLATFORM_ANDROID_KHR'
171 libanv_files += files('anv_android.c')
173 libanv_files += files('anv_android_stubs.c')
176 libanv_common = static_library(
179 libanv_files, anv_entrypoints, anv_extensions_c, anv_extensions_h, sha1_h,
182 include_directories : [
183 inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_intel, inc_compiler,
184 inc_vulkan_wsi, inc_util,
187 dependencies : anv_deps,
190 libvulkan_intel = shared_library(
192 [files('anv_gem.c'), anv_entrypoints[0], anv_extensions_h],
193 include_directories : [
194 inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_intel, inc_compiler, inc_vulkan_wsi,
196 link_whole : [libanv_common, libanv_gen_libs],
198 libintel_compiler, libintel_dev, libisl, libblorp, libvulkan_wsi,
202 dep_thread, dep_dl, dep_m, anv_deps, idep_libintel_common,
203 idep_nir, idep_genxml, idep_vulkan_util, idep_mesautil, idep_xmlconfig,
206 link_args : ['-Wl,--build-id=sha1', ld_args_bsymbolic, ld_args_gc_sections],
210 if with_symbols_check
215 '--lib', libvulkan_intel,
216 '--symbols-file', vulkan_icd_symbols,
224 libvulkan_intel_test = static_library(
226 [files('anv_gem_stubs.c'), anv_entrypoints[0], anv_extensions_h],
227 include_directories : [
228 inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_intel, inc_compiler, inc_vulkan_wsi,
230 link_whole : libanv_common,
232 libanv_gen_libs, libintel_compiler, libintel_common, libintel_dev,
233 libisl, libblorp, libvulkan_wsi, libintel_perf,
236 dep_thread, dep_dl, dep_m, anv_deps,
237 idep_nir, idep_vulkan_util, idep_mesautil,
242 foreach t : ['block_pool_no_free', 'block_pool_grow_first',
243 'state_pool_no_free', 'state_pool_free_list_only',
244 'state_pool', 'state_pool_padding']
249 ['tests/@0@.c'.format(t), anv_entrypoints[0], anv_extensions_h],
250 c_args : [ c_sse2_args ],
251 link_with : libvulkan_intel_test,
252 dependencies : [dep_libdrm, dep_thread, dep_m, dep_valgrind, idep_vulkan_util, ],
253 include_directories : [
254 inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_intel, inc_compiler, inc_vulkan_wsi,