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 anv_entrypoints = custom_target(
22 'anv_entrypoints.[ch]',
23 input : ['anv_entrypoints_gen.py', vk_api_xml, vk_android_native_buffer_xml,
25 output : ['anv_entrypoints.h', 'anv_entrypoints.c'],
27 prog_python2, '@INPUT0@', '--xml', '@INPUT1@', '--xml', '@INPUT2@',
28 '--outdir', meson.current_build_dir(),
30 depend_files : files('anv_extensions.py'),
33 anv_extensions_c = custom_target(
35 input : ['anv_extensions_gen.py', vk_api_xml, vk_android_native_buffer_xml,
37 output : 'anv_extensions.c',
39 prog_python2, '@INPUT0@', '--xml', '@INPUT1@', '--xml', '@INPUT2@',
44 intel_icd = custom_target(
47 output : 'intel_icd.@0@.json'.format(host_machine.cpu()),
49 prog_python2, '@INPUT@',
50 '--lib-path', join_paths(get_option('prefix'), get_option('libdir')),
53 depend_files : files('anv_extensions.py'),
54 build_by_default : true,
55 install_dir : with_vulkan_icd_dir,
59 dev_icd = custom_target(
62 output : 'dev_icd.@0@.json'.format(host_machine.cpu()),
64 prog_python2, '@INPUT@', '--lib-path', meson.current_build_dir(),
67 depend_files : files('anv_extensions.py'),
68 build_by_default : true,
72 # TODO: workaround for anv_entrypoints combining the .h and .c files in it's
73 # output. See issue #2346
74 block_entrypoints = custom_target(
76 command : [prog_touch, '@OUTPUT@'],
78 depends : anv_entrypoints,
82 anv_gen_files = files(
90 foreach g : [['70', ['gen7_cmd_buffer.c']], ['75', ['gen7_cmd_buffer.c']],
91 ['80', ['gen8_cmd_buffer.c']], ['90', ['gen8_cmd_buffer.c']],
92 ['100', ['gen8_cmd_buffer.c']]]
94 libanv_gen_libs += static_library(
95 'libanv_gen@0@'.format(_gen),
96 [anv_gen_files, g[1], block_entrypoints],
97 include_directories : [
98 inc_common, inc_compiler, inc_drm_uapi, inc_intel, inc_vulkan_util,
102 c_vis_args, no_override_init_args, '-msse2',
103 '-DGEN_VERSIONx10=@0@'.format(_gen),
105 dependencies : [dep_libdrm, dep_valgrind, idep_nir_headers],
109 libanv_files = files(
114 'anv_descriptor_set.c',
122 'anv_nir_apply_pipeline_layout.c',
123 'anv_nir_lower_input_attachments.c',
124 'anv_nir_lower_multiview.c',
125 'anv_nir_lower_push_constants.c',
126 'anv_nir_lower_ycbcr_textures.c',
129 'anv_pipeline_cache.c',
144 no_override_init_args,
149 anv_deps += dep_xcb_dri3
151 '-DVK_USE_PLATFORM_XCB_KHR',
152 '-DVK_USE_PLATFORM_XLIB_KHR',
154 libanv_files += files('anv_wsi_x11.c')
157 if with_platform_wayland
158 anv_deps += dep_wayland_client
159 anv_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR'
160 libanv_files += files('anv_wsi_wayland.c')
163 libanv_common = static_library(
165 [libanv_files, anv_entrypoints, anv_extensions_c],
166 include_directories : [
167 inc_common, inc_intel, inc_compiler, inc_drm_uapi, inc_vulkan_util,
171 dependencies : anv_deps,
174 libvulkan_intel = shared_library(
176 [files('anv_gem.c'), block_entrypoints],
177 include_directories : [
178 inc_common, inc_intel, inc_compiler, inc_drm_uapi, inc_vulkan_util,
181 link_whole : [libanv_common, libanv_gen_libs],
183 libintel_compiler, libintel_common, libisl, libblorp, libvulkan_util,
184 libvulkan_wsi, libmesa_util,
187 dep_thread, dep_dl, dep_m, anv_deps, idep_nir,
190 link_args : ['-Wl,--build-id=sha1', ld_args_bsymbolic, ld_args_gc_sections],
195 libvulkan_intel_test = static_library(
197 [files('anv_gem_stubs.c'), block_entrypoints],
198 include_directories : [
199 inc_common, inc_intel, inc_compiler, inc_drm_uapi, inc_vulkan_util,
202 link_whole : libanv_common,
204 libanv_gen_libs, libintel_compiler, libintel_common, libisl, libblorp,
205 libvulkan_util, libvulkan_wsi, libmesa_util,
208 dep_thread, dep_dl, dep_m, anv_deps, idep_nir,
213 foreach t : ['block_pool_no_free', 'state_pool_no_free',
214 'state_pool_free_list_only', 'state_pool']
219 ['tests/@0@.c'.format(t), dummy_cpp, block_entrypoints],
220 link_with : libvulkan_intel_test,
221 dependencies : [dep_libdrm, dep_thread, dep_m, dep_valgrind],
222 include_directories : [
223 inc_common, inc_intel, inc_compiler, inc_vulkan_util, inc_vulkan_wsi,