gfxstream: build time guest autogeneration

By popular demand:

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246#note_2565866

Only Soong/meson builds supported at the moment.  Bazel
or BUILD.gn can be added later.

This reduces the size of checked-in code by ~94 kLOC.

Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
This commit is contained in:
Gurchetan Singh 2024-01-24 10:12:41 -08:00 committed by Marge Bot
parent 56ef52e1b0
commit c95f4dcc93
2 changed files with 42 additions and 12 deletions

View file

@ -20,7 +20,8 @@ endif
lib_vulkan_gfxstream = shared_library(
'vulkan_gfxstream',
files_lib_vulkan_gfxstream + files_lib_vulkan_enc + gfxstream_vk_entrypoints,
files_lib_vulkan_gfxstream + files_lib_vulkan_enc + gfxstream_vk_entrypoints +
gfxstream_guest_vk_autogen + vulkan_gfxstream_h,
cpp_args: gfxstream_guest_args + gfxstream_vk_wsi_args,
include_directories: [inc_vulkan_headers, inc_guest_iostream,
inc_vulkan_enc, inc_platform_virtgpu,

View file

@ -1,6 +1,46 @@
# Copyright 2022 Android Open Source Project
# SPDX-License-Identifier: MIT
output_host_path = meson.current_build_dir() + '/host/vulkan/cereal'
guest_enc_path = meson.current_build_dir()
gfxstream_guest_vk_autogen = custom_target(
'gfxstream_guest_vk_autogen',
output : [
'VkEncoder.h',
'goldfish_vk_counting_guest.h',
'goldfish_vk_deepcopy_guest.h',
'goldfish_vk_marshaling_guest.h',
'goldfish_vk_extension_structs_guest.h',
'goldfish_vk_reserved_marshaling_guest.h',
'goldfish_vk_transform_guest.h',
'goldfish_vk_counting_guest.cpp',
'goldfish_vk_deepcopy_guest.cpp',
'goldfish_vk_extension_structs_guest.cpp',
'goldfish_vk_marshaling_guest.cpp',
'goldfish_vk_reserved_marshaling_guest.cpp',
'goldfish_vk_transform_guest.cpp',
'VkEncoder.cpp',
'func_table.cpp',
],
env: {'GFXSTREAM_NO_CLANG_FMT': '1', 'CEREAL_VARIANT' : 'guest',
'GFXSTREAM_GUEST_ENCODER_DIR': guest_enc_path},
input: [genvk, vk_xml_gfxstream, vk_gfxstream_xml],
command: [prog_python, '@INPUT0@', '-registry', '@INPUT1@', '-registryGfxstream', '@INPUT2@',
'cereal', '-o', output_host_path],
)
vulkan_gfxstream_h = custom_target(
'vulkan_gfxstream_header',
output : [
'vulkan_gfxstream.h',
],
env: {'GFXSTREAM_NO_CLANG_FMT': '1', 'CEREAL_VARIANT' : 'guest'},
input: [genvk, vk_gfxstream_xml],
command: [prog_python, '@INPUT0@', '-registry', '@INPUT1@', 'vulkan_gfxstream.h',
'-o', guest_enc_path],
)
gfxstream_vk_entrypoints = custom_target(
'gfxstream_vk_entrypoints',
input : [vk_entrypoints_gen, vk_api_xml],
@ -19,19 +59,8 @@ files_lib_vulkan_enc = files(
'ResourceTracker.cpp',
'Resources.cpp',
'Validation.cpp',
'VkEncoder.cpp',
'VulkanHandleMapping.cpp',
'VulkanStreamGuest.cpp',
'func_table.cpp',
'goldfish_vk_counting_guest.cpp',
'goldfish_vk_counting_guest.h',
'goldfish_vk_deepcopy_guest.cpp',
'goldfish_vk_extension_structs_guest.cpp',
'goldfish_vk_marshaling_guest.cpp',
'goldfish_vk_reserved_marshaling_guest.cpp',
'goldfish_vk_transform_guest.cpp',
'gfxstream_vk_private.cpp',
'gfxstream_vk_private.cpp',
'gfxstream_vk_private.cpp',
'GfxStreamVulkanConnection.cpp',
)