2019-02-13 17:26:16 +00:00
|
|
|
# Copyright © 2017-2019 Intel Corporation
|
2017-09-15 01:57:17 +01:00
|
|
|
|
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
# of this software and associated documentation files (the "Software"), to deal
|
|
|
|
# in the Software without restriction, including without limitation the rights
|
|
|
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
# copies of the Software, and to permit persons to whom the Software is
|
|
|
|
# furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
# The above copyright notice and this permission notice shall be included in
|
|
|
|
# all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
# SOFTWARE.
|
|
|
|
|
2018-01-23 17:41:30 +00:00
|
|
|
anv_extensions_py = files('anv_extensions.py')
|
|
|
|
|
2017-09-15 01:57:17 +01:00
|
|
|
anv_entrypoints = custom_target(
|
|
|
|
'anv_entrypoints.[ch]',
|
2018-04-10 06:01:14 +01:00
|
|
|
input : ['anv_entrypoints_gen.py', vk_api_xml],
|
2017-09-15 01:57:17 +01:00
|
|
|
output : ['anv_entrypoints.h', 'anv_entrypoints.c'],
|
2017-12-11 23:56:08 +00:00
|
|
|
command : [
|
2018-08-09 09:27:26 +01:00
|
|
|
prog_python, '@INPUT0@', '--xml', '@INPUT1@',
|
2017-12-11 23:56:08 +00:00
|
|
|
'--outdir', meson.current_build_dir(),
|
|
|
|
],
|
2018-01-23 17:41:30 +00:00
|
|
|
depend_files : anv_extensions_py,
|
2017-09-15 01:57:17 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
anv_extensions_c = custom_target(
|
|
|
|
'anv_extensions.c',
|
2018-04-10 06:01:14 +01:00
|
|
|
input : ['anv_extensions_gen.py', vk_api_xml],
|
2017-09-15 01:57:17 +01:00
|
|
|
output : 'anv_extensions.c',
|
2017-12-11 23:56:08 +00:00
|
|
|
command : [
|
2018-08-09 09:27:26 +01:00
|
|
|
prog_python, '@INPUT0@', '--xml', '@INPUT1@',
|
2018-01-16 22:23:29 +00:00
|
|
|
'--out-c', '@OUTPUT@',
|
|
|
|
],
|
2018-01-23 17:41:30 +00:00
|
|
|
depend_files : anv_extensions_py,
|
2018-01-16 22:23:29 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
anv_extensions_h = custom_target(
|
|
|
|
'anv_extensions.h',
|
2018-04-10 06:01:14 +01:00
|
|
|
input : ['anv_extensions_gen.py', vk_api_xml],
|
2018-01-16 22:23:29 +00:00
|
|
|
output : 'anv_extensions.h',
|
|
|
|
command : [
|
2018-08-09 09:27:26 +01:00
|
|
|
prog_python, '@INPUT0@', '--xml', '@INPUT1@',
|
2018-01-16 22:23:29 +00:00
|
|
|
'--out-h', '@OUTPUT@',
|
2017-12-11 23:56:08 +00:00
|
|
|
],
|
2018-01-23 17:41:30 +00:00
|
|
|
depend_files : anv_extensions_py,
|
2017-09-15 01:57:17 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
intel_icd = custom_target(
|
|
|
|
'intel_icd',
|
|
|
|
input : 'anv_icd.py',
|
2017-11-09 23:02:13 +00:00
|
|
|
output : 'intel_icd.@0@.json'.format(host_machine.cpu()),
|
2017-12-11 23:56:08 +00:00
|
|
|
command : [
|
2018-08-09 09:27:26 +01:00
|
|
|
prog_python, '@INPUT@',
|
2017-12-11 23:56:08 +00:00
|
|
|
'--lib-path', join_paths(get_option('prefix'), get_option('libdir')),
|
|
|
|
'--out', '@OUTPUT@',
|
|
|
|
],
|
2018-01-23 17:41:30 +00:00
|
|
|
depend_files : anv_extensions_py,
|
2017-09-15 01:57:17 +01:00
|
|
|
build_by_default : true,
|
|
|
|
install_dir : with_vulkan_icd_dir,
|
|
|
|
install : true,
|
|
|
|
)
|
|
|
|
|
|
|
|
libanv_gen_libs = []
|
|
|
|
anv_gen_files = files(
|
|
|
|
'genX_blorp_exec.c',
|
|
|
|
'genX_cmd_buffer.c',
|
|
|
|
'genX_gpu_memcpy.c',
|
|
|
|
'genX_pipeline.c',
|
|
|
|
'genX_query.c',
|
|
|
|
'genX_state.c',
|
|
|
|
)
|
|
|
|
foreach g : [['70', ['gen7_cmd_buffer.c']], ['75', ['gen7_cmd_buffer.c']],
|
|
|
|
['80', ['gen8_cmd_buffer.c']], ['90', ['gen8_cmd_buffer.c']],
|
2017-12-13 09:18:07 +00:00
|
|
|
['100', ['gen8_cmd_buffer.c']], ['110', ['gen8_cmd_buffer.c']],
|
|
|
|
['120', ['gen8_cmd_buffer.c']]]
|
2017-09-15 01:57:17 +01:00
|
|
|
_gen = g[0]
|
2017-12-12 00:16:56 +00:00
|
|
|
libanv_gen_libs += static_library(
|
2018-06-15 11:31:52 +01:00
|
|
|
'anv_gen@0@'.format(_gen),
|
2018-04-26 18:20:57 +01:00
|
|
|
[anv_gen_files, g[1], anv_entrypoints[0], anv_extensions_h],
|
2017-12-11 23:56:08 +00:00
|
|
|
include_directories : [
|
2019-05-10 18:55:54 +01:00
|
|
|
inc_common, inc_compiler, inc_include, inc_intel, inc_vulkan_wsi,
|
2017-12-11 23:56:08 +00:00
|
|
|
],
|
|
|
|
c_args : [
|
2018-09-06 09:07:45 +01:00
|
|
|
c_vis_args, no_override_init_args, c_sse2_args,
|
2017-12-11 23:56:08 +00:00
|
|
|
'-DGEN_VERSIONx10=@0@'.format(_gen),
|
|
|
|
],
|
2019-05-10 18:55:54 +01:00
|
|
|
dependencies : [
|
|
|
|
dep_libdrm, dep_valgrind, idep_nir_headers, idep_genxml, idep_vulkan_util_headers,
|
|
|
|
],
|
2017-09-15 01:57:17 +01:00
|
|
|
)
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
libanv_files = files(
|
|
|
|
'anv_allocator.c',
|
2018-11-06 11:37:50 +00:00
|
|
|
'anv_android.h',
|
2017-09-15 01:57:17 +01:00
|
|
|
'anv_batch_chain.c',
|
|
|
|
'anv_blorp.c',
|
|
|
|
'anv_cmd_buffer.c',
|
|
|
|
'anv_descriptor_set.c',
|
|
|
|
'anv_device.c',
|
|
|
|
'anv_dump.c',
|
|
|
|
'anv_formats.c',
|
|
|
|
'anv_genX.h',
|
|
|
|
'anv_image.c',
|
|
|
|
'anv_intel.c',
|
|
|
|
'anv_nir.h',
|
2017-10-03 23:23:07 +01:00
|
|
|
'anv_nir_add_base_work_group_id.c',
|
2017-09-15 01:57:17 +01:00
|
|
|
'anv_nir_apply_pipeline_layout.c',
|
|
|
|
'anv_nir_lower_multiview.c',
|
|
|
|
'anv_nir_lower_push_constants.c',
|
2017-06-19 16:56:47 +01:00
|
|
|
'anv_nir_lower_ycbcr_textures.c',
|
2017-09-15 01:57:17 +01:00
|
|
|
'anv_pass.c',
|
2018-06-07 18:02:03 +01:00
|
|
|
'anv_perf.c',
|
2017-09-15 01:57:17 +01:00
|
|
|
'anv_pipeline.c',
|
|
|
|
'anv_pipeline_cache.c',
|
|
|
|
'anv_private.h',
|
|
|
|
'anv_queue.c',
|
|
|
|
'anv_util.c',
|
|
|
|
'anv_wsi.c',
|
|
|
|
'vk_format_info.h',
|
|
|
|
)
|
|
|
|
|
2018-01-16 21:42:34 +00:00
|
|
|
anv_deps = [
|
|
|
|
dep_libdrm,
|
|
|
|
dep_valgrind,
|
|
|
|
idep_nir_headers,
|
2019-05-10 18:55:54 +01:00
|
|
|
idep_vulkan_util_headers,
|
2019-10-27 00:04:33 +01:00
|
|
|
idep_xmlconfig_headers,
|
2018-01-16 21:42:34 +00:00
|
|
|
]
|
|
|
|
anv_flags = [
|
|
|
|
c_vis_args,
|
|
|
|
no_override_init_args,
|
2018-09-06 09:07:45 +01:00
|
|
|
c_sse2_args,
|
2018-01-16 21:42:34 +00:00
|
|
|
]
|
2017-09-15 01:57:17 +01:00
|
|
|
|
|
|
|
if with_platform_x11
|
|
|
|
anv_deps += dep_xcb_dri3
|
|
|
|
anv_flags += [
|
|
|
|
'-DVK_USE_PLATFORM_XCB_KHR',
|
|
|
|
'-DVK_USE_PLATFORM_XLIB_KHR',
|
|
|
|
]
|
|
|
|
libanv_files += files('anv_wsi_x11.c')
|
|
|
|
endif
|
|
|
|
|
|
|
|
if with_platform_wayland
|
|
|
|
anv_deps += dep_wayland_client
|
|
|
|
anv_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR'
|
|
|
|
libanv_files += files('anv_wsi_wayland.c')
|
|
|
|
endif
|
|
|
|
|
2018-02-07 18:31:44 +00:00
|
|
|
if with_platform_drm
|
|
|
|
anv_flags += '-DVK_USE_PLATFORM_DISPLAY_KHR'
|
|
|
|
libanv_files += files('anv_wsi_display.c')
|
|
|
|
endif
|
|
|
|
|
2018-02-09 15:45:58 +00:00
|
|
|
if with_xlib_lease
|
2018-06-19 23:58:30 +01:00
|
|
|
anv_deps += [dep_xcb_xrandr, dep_xlib_xrandr]
|
2018-02-09 15:45:58 +00:00
|
|
|
anv_flags += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'
|
|
|
|
endif
|
|
|
|
|
2019-06-19 14:05:40 +01:00
|
|
|
if with_platform_android
|
|
|
|
anv_flags += '-DVK_USE_PLATFORM_ANDROID_KHR'
|
|
|
|
libanv_files += files('anv_android.c')
|
|
|
|
else
|
|
|
|
libanv_files += files('anv_android_stubs.c')
|
|
|
|
endif
|
|
|
|
|
2017-09-15 01:57:17 +01:00
|
|
|
libanv_common = static_library(
|
|
|
|
'anv_common',
|
2019-02-13 17:26:16 +00:00
|
|
|
[
|
|
|
|
libanv_files, anv_entrypoints, anv_extensions_c, anv_extensions_h, sha1_h,
|
|
|
|
gen_xml_pack,
|
|
|
|
],
|
2017-12-11 23:56:08 +00:00
|
|
|
include_directories : [
|
2019-05-10 18:55:54 +01:00
|
|
|
inc_common, inc_intel, inc_compiler, inc_include,
|
2019-04-24 16:42:25 +01:00
|
|
|
inc_vulkan_wsi, inc_util,
|
2017-12-11 23:56:08 +00:00
|
|
|
],
|
2018-01-16 21:42:34 +00:00
|
|
|
c_args : anv_flags,
|
|
|
|
dependencies : anv_deps,
|
2017-09-15 01:57:17 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
libvulkan_intel = shared_library(
|
|
|
|
'vulkan_intel',
|
2018-04-16 22:34:35 +01:00
|
|
|
[files('anv_gem.c'), anv_entrypoints[0], anv_extensions_h],
|
2017-12-11 23:56:08 +00:00
|
|
|
include_directories : [
|
2019-05-10 18:55:54 +01:00
|
|
|
inc_common, inc_intel, inc_compiler, inc_include, inc_vulkan_wsi,
|
2017-12-11 23:56:08 +00:00
|
|
|
],
|
2017-09-15 01:57:17 +01:00
|
|
|
link_whole : [libanv_common, libanv_gen_libs],
|
2017-12-11 23:56:08 +00:00
|
|
|
link_with : [
|
2019-07-26 12:49:59 +01:00
|
|
|
libintel_compiler, libintel_dev, libisl, libblorp, libvulkan_wsi,
|
2018-06-07 18:02:03 +01:00
|
|
|
libintel_perf,
|
2017-12-12 20:22:56 +00:00
|
|
|
],
|
|
|
|
dependencies : [
|
2019-07-26 12:49:59 +01:00
|
|
|
dep_thread, dep_dl, dep_m, anv_deps, idep_libintel_common,
|
2019-04-24 16:42:25 +01:00
|
|
|
idep_nir, idep_genxml, idep_vulkan_util, idep_mesautil, idep_xmlconfig,
|
2017-12-11 23:56:08 +00:00
|
|
|
],
|
2018-01-16 21:42:34 +00:00
|
|
|
c_args : anv_flags,
|
2017-09-15 01:57:17 +01:00
|
|
|
link_args : ['-Wl,--build-id=sha1', ld_args_bsymbolic, ld_args_gc_sections],
|
|
|
|
install : true,
|
|
|
|
)
|
|
|
|
|
2019-10-29 14:21:08 +00:00
|
|
|
if with_symbols_check
|
2018-10-11 15:19:13 +01:00
|
|
|
test(
|
|
|
|
'anv symbols check',
|
|
|
|
symbols_check,
|
|
|
|
args : [
|
|
|
|
'--lib', libvulkan_intel,
|
|
|
|
'--symbols-file', vulkan_icd_symbols,
|
|
|
|
'--nm', prog_nm.path(),
|
|
|
|
],
|
|
|
|
suite : ['intel'],
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
2017-09-15 01:57:17 +01:00
|
|
|
if with_tests
|
|
|
|
libvulkan_intel_test = static_library(
|
|
|
|
'vulkan_intel_test',
|
2018-04-16 22:34:35 +01:00
|
|
|
[files('anv_gem_stubs.c'), anv_entrypoints[0], anv_extensions_h],
|
2017-12-11 23:56:08 +00:00
|
|
|
include_directories : [
|
2019-05-10 18:55:54 +01:00
|
|
|
inc_common, inc_intel, inc_compiler, inc_include, inc_vulkan_wsi,
|
2017-12-11 23:56:08 +00:00
|
|
|
],
|
2017-09-15 01:57:17 +01:00
|
|
|
link_whole : libanv_common,
|
2017-12-11 23:56:08 +00:00
|
|
|
link_with : [
|
2018-02-26 23:39:59 +00:00
|
|
|
libanv_gen_libs, libintel_compiler, libintel_common, libintel_dev,
|
2018-06-07 18:02:03 +01:00
|
|
|
libisl, libblorp, libvulkan_wsi, libintel_perf,
|
2017-12-11 23:56:08 +00:00
|
|
|
],
|
|
|
|
dependencies : [
|
2019-07-22 14:50:15 +01:00
|
|
|
dep_thread, dep_dl, dep_m, anv_deps,
|
|
|
|
idep_nir, idep_vulkan_util, idep_mesautil,
|
2017-12-11 23:56:08 +00:00
|
|
|
],
|
2018-01-16 21:42:34 +00:00
|
|
|
c_args : anv_flags,
|
2017-09-15 01:57:17 +01:00
|
|
|
)
|
|
|
|
|
2019-07-12 22:37:38 +01:00
|
|
|
foreach t : ['block_pool_no_free', 'block_pool_grow_first',
|
|
|
|
'state_pool_no_free', 'state_pool_free_list_only',
|
|
|
|
'state_pool', 'state_pool_padding']
|
2017-12-12 00:13:31 +00:00
|
|
|
test(
|
|
|
|
'anv_@0@'.format(t),
|
|
|
|
executable(
|
|
|
|
t,
|
2018-04-26 18:20:57 +01:00
|
|
|
['tests/@0@.c'.format(t), anv_entrypoints[0], anv_extensions_h],
|
2018-12-30 21:09:06 +00:00
|
|
|
c_args : [ c_sse2_args ],
|
2017-12-12 00:13:31 +00:00
|
|
|
link_with : libvulkan_intel_test,
|
2019-05-10 18:55:54 +01:00
|
|
|
dependencies : [dep_libdrm, dep_thread, dep_m, dep_valgrind, idep_vulkan_util, ],
|
2017-12-12 00:13:31 +00:00
|
|
|
include_directories : [
|
2019-05-10 18:55:54 +01:00
|
|
|
inc_common, inc_intel, inc_compiler, inc_vulkan_wsi,
|
2017-12-12 00:13:31 +00:00
|
|
|
],
|
2018-11-19 21:44:15 +00:00
|
|
|
),
|
|
|
|
suite : ['intel'],
|
2017-09-15 01:57:17 +01:00
|
|
|
)
|
|
|
|
endforeach
|
|
|
|
endif
|