2018-08-08 23:23:57 +01:00
|
|
|
# Copyright © 2017 Intel Corporation
|
|
|
|
|
|
|
|
# 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.
|
|
|
|
|
|
|
|
tu_entrypoints = custom_target(
|
2021-01-28 19:53:02 +00:00
|
|
|
'tu_entrypoints',
|
|
|
|
input : [vk_entrypoints_gen, vk_api_xml],
|
2018-08-08 23:23:57 +01:00
|
|
|
output : ['tu_entrypoints.h', 'tu_entrypoints.c'],
|
|
|
|
command : [
|
2021-01-28 19:53:02 +00:00
|
|
|
prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',
|
|
|
|
'--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'tu',
|
2018-08-08 23:23:57 +01:00
|
|
|
],
|
2021-03-29 20:39:07 +01:00
|
|
|
depend_files : vk_entrypoints_gen_depend_files,
|
2018-08-08 23:23:57 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
libtu_files = files(
|
2020-03-13 15:57:23 +00:00
|
|
|
'tu_clear_blit.c',
|
2018-08-08 23:23:57 +01:00
|
|
|
'tu_cmd_buffer.c',
|
2019-01-16 17:27:04 +00:00
|
|
|
'tu_cs.c',
|
2019-10-05 17:38:40 +01:00
|
|
|
'tu_cs.h',
|
2018-08-08 23:23:57 +01:00
|
|
|
'tu_device.c',
|
|
|
|
'tu_descriptor_set.c',
|
|
|
|
'tu_descriptor_set.h',
|
|
|
|
'tu_formats.c',
|
|
|
|
'tu_image.c',
|
2020-09-29 17:04:17 +01:00
|
|
|
'tu_legacy.c',
|
2020-07-13 18:27:53 +01:00
|
|
|
'tu_nir_lower_multiview.c',
|
2018-08-08 23:23:57 +01:00
|
|
|
'tu_pass.c',
|
|
|
|
'tu_pipeline.c',
|
|
|
|
'tu_pipeline_cache.c',
|
|
|
|
'tu_private.h',
|
|
|
|
'tu_query.c',
|
2019-02-20 17:53:47 +00:00
|
|
|
'tu_shader.c',
|
2018-08-08 23:23:57 +01:00
|
|
|
'tu_util.c',
|
|
|
|
'tu_util.h',
|
2021-05-24 17:54:47 +01:00
|
|
|
'tu_perfetto.h',
|
2018-08-08 23:23:57 +01:00
|
|
|
'vk_format.h',
|
|
|
|
)
|
|
|
|
|
|
|
|
tu_deps = []
|
|
|
|
tu_flags = []
|
2020-09-18 22:36:36 +01:00
|
|
|
tu_link_with = []
|
|
|
|
|
|
|
|
tu_wsi = false
|
2018-08-08 23:23:57 +01:00
|
|
|
|
2019-11-13 22:02:43 +00:00
|
|
|
if with_platform_x11
|
|
|
|
tu_deps += dep_xcb_dri3
|
|
|
|
tu_flags += [
|
|
|
|
'-DVK_USE_PLATFORM_XCB_KHR',
|
|
|
|
'-DVK_USE_PLATFORM_XLIB_KHR',
|
|
|
|
]
|
|
|
|
libtu_files += files('tu_wsi_x11.c')
|
2020-09-18 22:36:36 +01:00
|
|
|
tu_wsi = true
|
2019-11-13 22:02:43 +00:00
|
|
|
endif
|
|
|
|
|
2019-02-08 21:45:53 +00:00
|
|
|
if with_platform_wayland
|
|
|
|
tu_deps += dep_wayland_client
|
|
|
|
tu_flags += '-DVK_USE_PLATFORM_WAYLAND_KHR'
|
|
|
|
libtu_files += files('tu_wsi_wayland.c')
|
2020-09-18 22:36:36 +01:00
|
|
|
tu_wsi = true
|
2019-02-08 21:45:53 +00:00
|
|
|
endif
|
|
|
|
|
2020-07-11 09:17:30 +01:00
|
|
|
if system_has_kms_drm and not with_platform_android
|
2019-11-13 21:50:36 +00:00
|
|
|
tu_flags += '-DVK_USE_PLATFORM_DISPLAY_KHR'
|
|
|
|
libtu_files += files('tu_wsi_display.c')
|
2020-09-18 22:36:36 +01:00
|
|
|
tu_wsi = true
|
|
|
|
endif
|
|
|
|
|
|
|
|
if tu_wsi
|
|
|
|
libtu_files += 'tu_wsi.c'
|
|
|
|
tu_link_with += libvulkan_wsi
|
2019-11-13 21:50:36 +00:00
|
|
|
endif
|
|
|
|
|
2020-04-07 17:04:00 +01:00
|
|
|
if with_platform_android
|
|
|
|
tu_flags += '-DVK_USE_PLATFORM_ANDROID_KHR'
|
|
|
|
libtu_files += files('tu_android.c')
|
|
|
|
tu_deps += [dep_android]
|
|
|
|
endif
|
|
|
|
|
2019-11-13 22:02:43 +00:00
|
|
|
if with_xlib_lease
|
2020-12-21 11:11:40 +00:00
|
|
|
tu_deps += [dep_xlib_xrandr]
|
2019-11-13 22:02:43 +00:00
|
|
|
tu_flags += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'
|
|
|
|
endif
|
|
|
|
|
2020-04-07 20:36:20 +01:00
|
|
|
if with_freedreno_kgsl
|
2021-06-18 01:52:00 +01:00
|
|
|
tu_flags += '-DTU_USE_KGSL'
|
2020-04-07 20:36:20 +01:00
|
|
|
libtu_files += files('tu_kgsl.c')
|
|
|
|
else
|
|
|
|
libtu_files += files('tu_drm.c')
|
2020-09-18 20:43:18 +01:00
|
|
|
tu_deps += dep_libdrm
|
2020-04-07 20:36:20 +01:00
|
|
|
endif
|
|
|
|
|
2021-05-24 17:54:47 +01:00
|
|
|
tu_tracepoints = custom_target(
|
|
|
|
'tu_tracepoints.[ch]',
|
|
|
|
input: 'tu_tracepoints.py',
|
|
|
|
output: ['tu_tracepoints.c', 'tu_tracepoints.h', 'tu_tracepoints_perfetto.h'],
|
|
|
|
command: [
|
|
|
|
prog_python, '@INPUT@',
|
|
|
|
'-p', join_paths(meson.source_root(), 'src/util/perf/'),
|
|
|
|
'--utrace-src', '@OUTPUT0@',
|
|
|
|
'--utrace-hdr', '@OUTPUT1@',
|
|
|
|
'--perfetto-hdr', '@OUTPUT2@',
|
|
|
|
],
|
|
|
|
depend_files: u_trace_py,
|
|
|
|
)
|
|
|
|
|
|
|
|
if with_perfetto
|
|
|
|
libtu_files += ['tu_perfetto.cc', 'tu_perfetto_util.c']
|
|
|
|
tu_deps += dep_perfetto
|
|
|
|
endif
|
|
|
|
|
2018-08-08 23:23:57 +01:00
|
|
|
libvulkan_freedreno = shared_library(
|
|
|
|
'vulkan_freedreno',
|
2021-05-24 17:54:47 +01:00
|
|
|
[libtu_files, tu_entrypoints, tu_tracepoints, freedreno_xml_header_files],
|
2018-08-08 23:23:57 +01:00
|
|
|
include_directories : [
|
2019-03-05 16:21:47 +00:00
|
|
|
inc_include,
|
|
|
|
inc_src,
|
|
|
|
inc_mapi,
|
|
|
|
inc_mesa,
|
|
|
|
inc_gallium,
|
|
|
|
inc_gallium_aux,
|
2018-08-09 10:09:01 +01:00
|
|
|
inc_compiler,
|
2019-02-08 21:45:53 +00:00
|
|
|
inc_vulkan_wsi,
|
2018-08-09 10:09:01 +01:00
|
|
|
inc_freedreno,
|
2018-08-08 23:23:57 +01:00
|
|
|
],
|
|
|
|
link_with : [
|
2020-09-18 22:36:36 +01:00
|
|
|
tu_link_with,
|
2019-02-20 17:53:47 +00:00
|
|
|
libfreedreno_ir3,
|
2019-11-26 20:02:34 +00:00
|
|
|
libfreedreno_layout,
|
2020-11-20 05:32:27 +00:00
|
|
|
libfreedreno_perfcntrs,
|
2018-08-08 23:23:57 +01:00
|
|
|
],
|
|
|
|
dependencies : [
|
2020-04-09 11:56:08 +01:00
|
|
|
idep_libfreedreno_common,
|
2018-08-08 23:23:57 +01:00
|
|
|
dep_dl,
|
|
|
|
dep_elf,
|
|
|
|
dep_m,
|
|
|
|
dep_thread,
|
|
|
|
dep_valgrind,
|
|
|
|
idep_nir,
|
2019-02-08 21:45:53 +00:00
|
|
|
tu_deps,
|
2019-05-10 18:55:54 +01:00
|
|
|
idep_vulkan_util,
|
2019-07-22 14:50:15 +01:00
|
|
|
idep_mesautil,
|
2018-08-08 23:23:57 +01:00
|
|
|
],
|
2020-04-24 21:10:41 +01:00
|
|
|
c_args : [no_override_init_args, tu_flags],
|
|
|
|
gnu_symbol_visibility : 'hidden',
|
2020-08-13 23:15:26 +01:00
|
|
|
link_args : [ld_args_bsymbolic, ld_args_gc_sections, ld_args_build_id],
|
2018-08-08 23:23:57 +01:00
|
|
|
install : true,
|
|
|
|
)
|
|
|
|
|
2019-10-29 14:21:08 +00:00
|
|
|
if with_symbols_check
|
2019-03-29 17:15:45 +00:00
|
|
|
test(
|
|
|
|
'tu symbols check',
|
|
|
|
symbols_check,
|
|
|
|
args : [
|
|
|
|
'--lib', libvulkan_freedreno,
|
|
|
|
'--symbols-file', vulkan_icd_symbols,
|
2019-10-29 21:32:05 +00:00
|
|
|
symbols_check_args,
|
2019-03-29 17:15:45 +00:00
|
|
|
],
|
|
|
|
suite : ['freedreno'],
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
2018-08-08 23:23:57 +01:00
|
|
|
freedreno_icd = custom_target(
|
|
|
|
'freedreno_icd',
|
2021-05-04 21:38:49 +01:00
|
|
|
input : [vk_icd_gen, vk_api_xml],
|
2018-08-08 23:23:57 +01:00
|
|
|
output : 'freedreno_icd.@0@.json'.format(host_machine.cpu()),
|
|
|
|
command : [
|
2021-05-04 21:38:49 +01:00
|
|
|
prog_python, '@INPUT0@',
|
|
|
|
'--api-version', '1.1', '--xml', '@INPUT1@',
|
|
|
|
'--lib-path', join_paths(get_option('prefix'), get_option('libdir'),
|
|
|
|
'libvulkan_freedreno.so'),
|
2018-08-08 23:23:57 +01:00
|
|
|
'--out', '@OUTPUT@',
|
|
|
|
],
|
|
|
|
build_by_default : true,
|
|
|
|
install_dir : with_vulkan_icd_dir,
|
|
|
|
install : true,
|
|
|
|
)
|