mesa/src/vulkan/runtime/meson.build

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

339 lines
9.7 KiB
Meson
Raw Normal View History

# Copyright © 2017 Intel Corporation
# SPDX-License-Identifier: MIT
# Mesa-local imports in the Python files must be declared here for correct
# dependency tracking.
vulkan: allow building venus without libcompiler This is done by introduce idep_vulkan_lite_runtime, and only venus depends on idep_vulkan_lite_runtime. Modify the meson and source files to allow building venus without the compiler. See details Venus build metrics at the MR description. gfxstream-vulkan forwards the shader to the host, and doesn't need to convert into NIR in the guest. This results in faster builds and less parts of Mesa to build. Also venus does the same thing too, that's what the build is keyed on right now as an in-tree user. v7: By Yonggang Luo <luoyonggang@gmail.com> Add idep_vulkan_common_entrypoints_h into vulkan_lite_runtime_deps because vk_instance.c depends on idep_vulkan_common_entrypoints_h but vk_common_entrypoints is not compiled in library `vulkan_lite_instance`. Rename idep_vulkan_runtime_headers to idep_vulkan_lite_runtime_headers because both lite/full runtime library depends on this, but lite should not depends on full vk_meta_private.h added into vulkan_runtime_files v6: By Yonggang Luo <luoyonggang@gmail.com> get vulkan_lite_runtime_files and vulkan_runtime_files sorted v5: By Yiwei Zhang <zzyiwei@chromium.org> both vk_sampler and vk_ycbcr_conversion can stay in the lite runtime v4: By Yonggang Luo <luoyonggang@gmail.com> only build vk_instance.(c|h) twice for reduce compiling time v3: By Yiwei Zhang <zzyiwei@chromium.org> less code changes by introduce libvulkan_lite_runtime v2: By Yonggang Luo <luoyonggang@gmail.com> allow building Vulkan without libcompiler without compiling flags, the venus is always built without libcompiler v1: By Gurchetan Singh <gurchetansingh@google.com> allow building Vulkan without libcompiler Signed-off-by: Gurchetan Singh <gurchetansingh@google.com> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26574>
2024-03-05 02:58:22 +08:00
vulkan_lite_runtime_files = files(
'rmv/vk_rmv_common.c',
'rmv/vk_rmv_exporter.c',
'vk_blend.c',
'vk_buffer.c',
'vk_buffer_view.c',
'vk_cmd_copy.c',
'vk_cmd_enqueue.c',
'vk_command_buffer.c',
'vk_command_pool.c',
'vk_debug_report.c',
'vk_debug_utils.c',
'vk_deferred_operation.c',
'vk_descriptor_set_layout.c',
'vk_descriptors.c',
'vk_descriptor_update_template.c',
'vk_device.c',
'vk_device_generated_commands.c',
'vk_device_memory.c',
'vk_fence.c',
'vk_framebuffer.c',
'vk_graphics_state.c',
'vk_image.c',
'vk_log.c',
'vk_meta_object_list.c',
'vk_object.c',
'vk_physical_device.c',
'vk_pipeline_layout.c',
'vk_query_pool.c',
'vk_queue.c',
'vk_render_pass.c',
'vk_sampler.c',
'vk_semaphore.c',
'vk_standard_sample_locations.c',
'vk_sync.c',
'vk_sync_binary.c',
'vk_sync_dummy.c',
'vk_sync_timeline.c',
'vk_synchronization.c',
'vk_video.c',
'vk_ycbcr_conversion.c',
)
vulkan: allow building venus without libcompiler This is done by introduce idep_vulkan_lite_runtime, and only venus depends on idep_vulkan_lite_runtime. Modify the meson and source files to allow building venus without the compiler. See details Venus build metrics at the MR description. gfxstream-vulkan forwards the shader to the host, and doesn't need to convert into NIR in the guest. This results in faster builds and less parts of Mesa to build. Also venus does the same thing too, that's what the build is keyed on right now as an in-tree user. v7: By Yonggang Luo <luoyonggang@gmail.com> Add idep_vulkan_common_entrypoints_h into vulkan_lite_runtime_deps because vk_instance.c depends on idep_vulkan_common_entrypoints_h but vk_common_entrypoints is not compiled in library `vulkan_lite_instance`. Rename idep_vulkan_runtime_headers to idep_vulkan_lite_runtime_headers because both lite/full runtime library depends on this, but lite should not depends on full vk_meta_private.h added into vulkan_runtime_files v6: By Yonggang Luo <luoyonggang@gmail.com> get vulkan_lite_runtime_files and vulkan_runtime_files sorted v5: By Yiwei Zhang <zzyiwei@chromium.org> both vk_sampler and vk_ycbcr_conversion can stay in the lite runtime v4: By Yonggang Luo <luoyonggang@gmail.com> only build vk_instance.(c|h) twice for reduce compiling time v3: By Yiwei Zhang <zzyiwei@chromium.org> less code changes by introduce libvulkan_lite_runtime v2: By Yonggang Luo <luoyonggang@gmail.com> allow building Vulkan without libcompiler without compiling flags, the venus is always built without libcompiler v1: By Gurchetan Singh <gurchetansingh@google.com> allow building Vulkan without libcompiler Signed-off-by: Gurchetan Singh <gurchetansingh@google.com> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26574>
2024-03-05 02:58:22 +08:00
vulkan_lite_runtime_deps = [
vulkan_wsi_deps,
idep_mesautil,
vulkan: allow building venus without libcompiler This is done by introduce idep_vulkan_lite_runtime, and only venus depends on idep_vulkan_lite_runtime. Modify the meson and source files to allow building venus without the compiler. See details Venus build metrics at the MR description. gfxstream-vulkan forwards the shader to the host, and doesn't need to convert into NIR in the guest. This results in faster builds and less parts of Mesa to build. Also venus does the same thing too, that's what the build is keyed on right now as an in-tree user. v7: By Yonggang Luo <luoyonggang@gmail.com> Add idep_vulkan_common_entrypoints_h into vulkan_lite_runtime_deps because vk_instance.c depends on idep_vulkan_common_entrypoints_h but vk_common_entrypoints is not compiled in library `vulkan_lite_instance`. Rename idep_vulkan_runtime_headers to idep_vulkan_lite_runtime_headers because both lite/full runtime library depends on this, but lite should not depends on full vk_meta_private.h added into vulkan_runtime_files v6: By Yonggang Luo <luoyonggang@gmail.com> get vulkan_lite_runtime_files and vulkan_runtime_files sorted v5: By Yiwei Zhang <zzyiwei@chromium.org> both vk_sampler and vk_ycbcr_conversion can stay in the lite runtime v4: By Yonggang Luo <luoyonggang@gmail.com> only build vk_instance.(c|h) twice for reduce compiling time v3: By Yiwei Zhang <zzyiwei@chromium.org> less code changes by introduce libvulkan_lite_runtime v2: By Yonggang Luo <luoyonggang@gmail.com> allow building Vulkan without libcompiler without compiling flags, the venus is always built without libcompiler v1: By Gurchetan Singh <gurchetansingh@google.com> allow building Vulkan without libcompiler Signed-off-by: Gurchetan Singh <gurchetansingh@google.com> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26574>
2024-03-05 02:58:22 +08:00
idep_nir_headers,
idep_vulkan_util,
]
if dep_libdrm.found()
vulkan_lite_runtime_files += files('vk_drm_syncobj.c')
vulkan: allow building venus without libcompiler This is done by introduce idep_vulkan_lite_runtime, and only venus depends on idep_vulkan_lite_runtime. Modify the meson and source files to allow building venus without the compiler. See details Venus build metrics at the MR description. gfxstream-vulkan forwards the shader to the host, and doesn't need to convert into NIR in the guest. This results in faster builds and less parts of Mesa to build. Also venus does the same thing too, that's what the build is keyed on right now as an in-tree user. v7: By Yonggang Luo <luoyonggang@gmail.com> Add idep_vulkan_common_entrypoints_h into vulkan_lite_runtime_deps because vk_instance.c depends on idep_vulkan_common_entrypoints_h but vk_common_entrypoints is not compiled in library `vulkan_lite_instance`. Rename idep_vulkan_runtime_headers to idep_vulkan_lite_runtime_headers because both lite/full runtime library depends on this, but lite should not depends on full vk_meta_private.h added into vulkan_runtime_files v6: By Yonggang Luo <luoyonggang@gmail.com> get vulkan_lite_runtime_files and vulkan_runtime_files sorted v5: By Yiwei Zhang <zzyiwei@chromium.org> both vk_sampler and vk_ycbcr_conversion can stay in the lite runtime v4: By Yonggang Luo <luoyonggang@gmail.com> only build vk_instance.(c|h) twice for reduce compiling time v3: By Yiwei Zhang <zzyiwei@chromium.org> less code changes by introduce libvulkan_lite_runtime v2: By Yonggang Luo <luoyonggang@gmail.com> allow building Vulkan without libcompiler without compiling flags, the venus is always built without libcompiler v1: By Gurchetan Singh <gurchetansingh@google.com> allow building Vulkan without libcompiler Signed-off-by: Gurchetan Singh <gurchetansingh@google.com> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26574>
2024-03-05 02:58:22 +08:00
vulkan_lite_runtime_deps += dep_libdrm
endif
if with_platform_android
vulkan_lite_runtime_files += files('vk_android.c')
vulkan_lite_runtime_deps += [dep_android, idep_u_gralloc]
vulkan/runtime: add compute astc decoder helper functions The astc compute decode and lut creation code is copied from https://github.com/Themaister/Granite/ Always set DECODE_8BIT idea is copied from https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19886 v2: use astc glsl shader code (Chia-I Wu) v3: fix 32bit compilation error (Christopher Snowhill) v4: use pitch to copy in vk_create_fill_image_visible_mem() function pass correct layer to decode_astc() v5: use existing ASTCLutHolder (Chia-I Wu) v6: use only staging buffer (Chia-I Wu) use texel buffer for partition table (Chia-I Wu) v7: use 2DArray for input and output v8: check for == mem_property (Chia-I Wu) do not use vk_common* functions (Chia-I Wu) squash single buffer patch (Chia-I Wu) fix for minTexelBufferOffsetAlignment (Chia-I Wu) avoid wasting 4 slots (Chia-I Wu) remove partition_tbl_mask (Chia-I Wu) remove wrong bindings count (Chia-I Wu) use binding names from glsl code (Chia-I Wu) use ARRAY_SIZE (Chia-I Wu) use VkFormat for getting partition table index (Chia-I Wu) fix mutex lock (Chia-I Wu) image layout should be based on function call (Chia-I Wu) VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE is wrong (Chia-I Wu) add vk_texcompress_astc tag to helpder functions (Chia-I Wu) remove write_desc_set_count (Chia-I Wu) use desc_i++ (Chia-I Wu) add assert for desc_i count at end (Chia-I Wu) remove unused vk_create_map_texel_buffer() function (Chia-I Wu) dynamically create the lut offset (Chia-I Wu) offset not to pass as push contant (Chia-I Wu) v9: use correct stoage and sampled flags (Chia-I Wu) always pass single_buf_size (Chia-I Wu) query drivers for minTexelBufferOffsetAlignment (Chia-I Wu) remove blank lines (Chia-I Wu) remove unnecessary if check in destroy (Chia-I Wu) name label as unlock instead of fail and pass (Chia-I Wu) use prog_glslang.found() (Chia-I Wu) add offset,extent check to astc shader (Chia-I Wu) v10: prog_glslang can be undefined in meson.build (Chia-I Wu) v11: remove with_texcompress_astc and use required in find_program (Chia-I Wu) v12: offset are aligned to blk size (Chia-I Wu) v13: texel_blk_start should be under vulkan if check (Chia-I Wu) dst image layout is always VK_IMAGE_LAYOUT_GENERAL (Chia-I Wu) Reviewed-by: Chia-I Wu <olvaffe@gmail.com> Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24672>
2023-09-07 17:03:03 +05:30
endif
vk_common_entrypoints = custom_target(
'vk_common_entrypoints',
input : [vk_entrypoints_gen, vk_api_xml],
output : ['vk_common_entrypoints.h', 'vk_common_entrypoints.c'],
command : [
prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',
'--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'vk_common',
'--beta', with_vulkan_beta.to_string()
],
depend_files : vk_entrypoints_gen_depend_files,
)
vk_cmd_queue = custom_target(
'vk_cmd_queue',
input : [vk_cmd_queue_gen, vk_api_xml],
output : ['vk_cmd_queue.c', 'vk_cmd_queue.h'],
command : [
prog_python, '@INPUT0@', '--xml', '@INPUT1@',
'--out-c', '@OUTPUT0@', '--out-h', '@OUTPUT1@',
'--beta', with_vulkan_beta.to_string()
],
depend_files : vk_cmd_queue_gen_depend_files,
)
vk_cmd_enqueue_entrypoints = custom_target(
'vk_cmd_enqueue_entrypoints',
input : [vk_entrypoints_gen, vk_api_xml],
output : ['vk_cmd_enqueue_entrypoints.h', 'vk_cmd_enqueue_entrypoints.c'],
command : [
prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',
'--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@',
'--prefix', 'vk_cmd_enqueue', '--prefix', 'vk_cmd_enqueue_unless_primary',
'--beta', with_vulkan_beta.to_string()
],
depend_files : vk_entrypoints_gen_depend_files,
)
vk_dispatch_trampolines = custom_target(
'vk_dispatch_trampolines',
input : [vk_dispatch_trampolines_gen, vk_api_xml],
output : ['vk_dispatch_trampolines.c', 'vk_dispatch_trampolines.h'],
command : [
prog_python, '@INPUT0@', '--xml', '@INPUT1@',
'--out-c', '@OUTPUT0@', '--out-h', '@OUTPUT1@',
'--beta', with_vulkan_beta.to_string()
],
depend_files : vk_dispatch_trampolines_gen_depend_files,
)
vk_physical_device_features = custom_target(
'vk_physical_device_features',
input : [vk_physical_device_features_gen, vk_api_xml],
output : ['vk_physical_device_features.c', 'vk_physical_device_features.h'],
command : [
prog_python, '@INPUT0@', '--xml', '@INPUT1@',
'--out-c', '@OUTPUT0@', '--out-h', '@OUTPUT1@',
'--beta', with_vulkan_beta.to_string()
],
depend_files : vk_physical_device_features_gen_depend_files,
)
vk_physical_device_properties = custom_target(
'vk_physical_device_properties',
input : [vk_physical_device_properties_gen, vk_api_xml],
output : ['vk_physical_device_properties.c', 'vk_physical_device_properties.h'],
command : [
prog_python, '@INPUT0@', '--xml', '@INPUT1@',
'--out-c', '@OUTPUT0@', '--out-h', '@OUTPUT1@',
'--beta', with_vulkan_beta.to_string()
],
depend_files : vk_physical_device_properties_gen_depend_files,
)
vk_physical_device_spirv_caps = custom_target(
'vk_physical_device_spirv_caps',
input : [vk_physical_device_spirv_caps_gen, vk_api_xml],
output : 'vk_physical_device_spirv_caps.c',
command : [
prog_python, '@INPUT0@', '--xml', '@INPUT1@',
'--out-c', '@OUTPUT0@', '--beta', with_vulkan_beta.to_string()
],
depend_files : vk_physical_device_spirv_caps_gen_depend_files,
)
vk_synchronization_helpers = custom_target(
'vk_synchronization_helpers',
input : [vk_synchronization_helpers_gen, vk_api_xml],
output : 'vk_synchronization_helpers.c',
command : [
prog_python, '@INPUT0@', '--xml', '@INPUT1@',
'--out-c', '@OUTPUT0@',
'--beta', with_vulkan_beta.to_string()
],
depend_files : vk_synchronization_helpers_gen_depend_files,
)
vk_format_info = custom_target(
'vk_format_info',
input : ['vk_format_info_gen.py', vk_api_xml],
output : ['vk_format_info.c', 'vk_format_info.h'],
command : [
prog_python, '@INPUT0@', '--xml', '@INPUT1@',
'--out-c', '@OUTPUT0@', '--out-h', '@OUTPUT1@'
],
)
vulkan: allow building venus without libcompiler This is done by introduce idep_vulkan_lite_runtime, and only venus depends on idep_vulkan_lite_runtime. Modify the meson and source files to allow building venus without the compiler. See details Venus build metrics at the MR description. gfxstream-vulkan forwards the shader to the host, and doesn't need to convert into NIR in the guest. This results in faster builds and less parts of Mesa to build. Also venus does the same thing too, that's what the build is keyed on right now as an in-tree user. v7: By Yonggang Luo <luoyonggang@gmail.com> Add idep_vulkan_common_entrypoints_h into vulkan_lite_runtime_deps because vk_instance.c depends on idep_vulkan_common_entrypoints_h but vk_common_entrypoints is not compiled in library `vulkan_lite_instance`. Rename idep_vulkan_runtime_headers to idep_vulkan_lite_runtime_headers because both lite/full runtime library depends on this, but lite should not depends on full vk_meta_private.h added into vulkan_runtime_files v6: By Yonggang Luo <luoyonggang@gmail.com> get vulkan_lite_runtime_files and vulkan_runtime_files sorted v5: By Yiwei Zhang <zzyiwei@chromium.org> both vk_sampler and vk_ycbcr_conversion can stay in the lite runtime v4: By Yonggang Luo <luoyonggang@gmail.com> only build vk_instance.(c|h) twice for reduce compiling time v3: By Yiwei Zhang <zzyiwei@chromium.org> less code changes by introduce libvulkan_lite_runtime v2: By Yonggang Luo <luoyonggang@gmail.com> allow building Vulkan without libcompiler without compiling flags, the venus is always built without libcompiler v1: By Gurchetan Singh <gurchetansingh@google.com> allow building Vulkan without libcompiler Signed-off-by: Gurchetan Singh <gurchetansingh@google.com> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26574>
2024-03-05 02:58:22 +08:00
vulkan_lite_runtime_files += [
vk_cmd_enqueue_entrypoints,
vk_cmd_queue,
vk_common_entrypoints,
vulkan: allow building venus without libcompiler This is done by introduce idep_vulkan_lite_runtime, and only venus depends on idep_vulkan_lite_runtime. Modify the meson and source files to allow building venus without the compiler. See details Venus build metrics at the MR description. gfxstream-vulkan forwards the shader to the host, and doesn't need to convert into NIR in the guest. This results in faster builds and less parts of Mesa to build. Also venus does the same thing too, that's what the build is keyed on right now as an in-tree user. v7: By Yonggang Luo <luoyonggang@gmail.com> Add idep_vulkan_common_entrypoints_h into vulkan_lite_runtime_deps because vk_instance.c depends on idep_vulkan_common_entrypoints_h but vk_common_entrypoints is not compiled in library `vulkan_lite_instance`. Rename idep_vulkan_runtime_headers to idep_vulkan_lite_runtime_headers because both lite/full runtime library depends on this, but lite should not depends on full vk_meta_private.h added into vulkan_runtime_files v6: By Yonggang Luo <luoyonggang@gmail.com> get vulkan_lite_runtime_files and vulkan_runtime_files sorted v5: By Yiwei Zhang <zzyiwei@chromium.org> both vk_sampler and vk_ycbcr_conversion can stay in the lite runtime v4: By Yonggang Luo <luoyonggang@gmail.com> only build vk_instance.(c|h) twice for reduce compiling time v3: By Yiwei Zhang <zzyiwei@chromium.org> less code changes by introduce libvulkan_lite_runtime v2: By Yonggang Luo <luoyonggang@gmail.com> allow building Vulkan without libcompiler without compiling flags, the venus is always built without libcompiler v1: By Gurchetan Singh <gurchetansingh@google.com> allow building Vulkan without libcompiler Signed-off-by: Gurchetan Singh <gurchetansingh@google.com> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26574>
2024-03-05 02:58:22 +08:00
vk_dispatch_trampolines,
vk_format_info,
vulkan: allow building venus without libcompiler This is done by introduce idep_vulkan_lite_runtime, and only venus depends on idep_vulkan_lite_runtime. Modify the meson and source files to allow building venus without the compiler. See details Venus build metrics at the MR description. gfxstream-vulkan forwards the shader to the host, and doesn't need to convert into NIR in the guest. This results in faster builds and less parts of Mesa to build. Also venus does the same thing too, that's what the build is keyed on right now as an in-tree user. v7: By Yonggang Luo <luoyonggang@gmail.com> Add idep_vulkan_common_entrypoints_h into vulkan_lite_runtime_deps because vk_instance.c depends on idep_vulkan_common_entrypoints_h but vk_common_entrypoints is not compiled in library `vulkan_lite_instance`. Rename idep_vulkan_runtime_headers to idep_vulkan_lite_runtime_headers because both lite/full runtime library depends on this, but lite should not depends on full vk_meta_private.h added into vulkan_runtime_files v6: By Yonggang Luo <luoyonggang@gmail.com> get vulkan_lite_runtime_files and vulkan_runtime_files sorted v5: By Yiwei Zhang <zzyiwei@chromium.org> both vk_sampler and vk_ycbcr_conversion can stay in the lite runtime v4: By Yonggang Luo <luoyonggang@gmail.com> only build vk_instance.(c|h) twice for reduce compiling time v3: By Yiwei Zhang <zzyiwei@chromium.org> less code changes by introduce libvulkan_lite_runtime v2: By Yonggang Luo <luoyonggang@gmail.com> allow building Vulkan without libcompiler without compiling flags, the venus is always built without libcompiler v1: By Gurchetan Singh <gurchetansingh@google.com> allow building Vulkan without libcompiler Signed-off-by: Gurchetan Singh <gurchetansingh@google.com> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26574>
2024-03-05 02:58:22 +08:00
vk_physical_device_features,
vk_physical_device_properties,
vk_physical_device_spirv_caps,
vulkan: allow building venus without libcompiler This is done by introduce idep_vulkan_lite_runtime, and only venus depends on idep_vulkan_lite_runtime. Modify the meson and source files to allow building venus without the compiler. See details Venus build metrics at the MR description. gfxstream-vulkan forwards the shader to the host, and doesn't need to convert into NIR in the guest. This results in faster builds and less parts of Mesa to build. Also venus does the same thing too, that's what the build is keyed on right now as an in-tree user. v7: By Yonggang Luo <luoyonggang@gmail.com> Add idep_vulkan_common_entrypoints_h into vulkan_lite_runtime_deps because vk_instance.c depends on idep_vulkan_common_entrypoints_h but vk_common_entrypoints is not compiled in library `vulkan_lite_instance`. Rename idep_vulkan_runtime_headers to idep_vulkan_lite_runtime_headers because both lite/full runtime library depends on this, but lite should not depends on full vk_meta_private.h added into vulkan_runtime_files v6: By Yonggang Luo <luoyonggang@gmail.com> get vulkan_lite_runtime_files and vulkan_runtime_files sorted v5: By Yiwei Zhang <zzyiwei@chromium.org> both vk_sampler and vk_ycbcr_conversion can stay in the lite runtime v4: By Yonggang Luo <luoyonggang@gmail.com> only build vk_instance.(c|h) twice for reduce compiling time v3: By Yiwei Zhang <zzyiwei@chromium.org> less code changes by introduce libvulkan_lite_runtime v2: By Yonggang Luo <luoyonggang@gmail.com> allow building Vulkan without libcompiler without compiling flags, the venus is always built without libcompiler v1: By Gurchetan Singh <gurchetansingh@google.com> allow building Vulkan without libcompiler Signed-off-by: Gurchetan Singh <gurchetansingh@google.com> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26574>
2024-03-05 02:58:22 +08:00
vk_synchronization_helpers,
]
# as a runtime library dep to ensure header gen order
vulkan_lite_runtime_header_gen_deps = declare_dependency(
sources : [
spirv_info_h,
vk_cmd_enqueue_entrypoints[0],
vk_cmd_queue[1],
vk_common_entrypoints[0],
vk_dispatch_trampolines[1],
vk_format_info[1],
vk_physical_device_features[1],
vk_physical_device_properties[1],
],
)
vulkan_lite_runtime_deps += vulkan_lite_runtime_header_gen_deps
vulkan: allow building venus without libcompiler This is done by introduce idep_vulkan_lite_runtime, and only venus depends on idep_vulkan_lite_runtime. Modify the meson and source files to allow building venus without the compiler. See details Venus build metrics at the MR description. gfxstream-vulkan forwards the shader to the host, and doesn't need to convert into NIR in the guest. This results in faster builds and less parts of Mesa to build. Also venus does the same thing too, that's what the build is keyed on right now as an in-tree user. v7: By Yonggang Luo <luoyonggang@gmail.com> Add idep_vulkan_common_entrypoints_h into vulkan_lite_runtime_deps because vk_instance.c depends on idep_vulkan_common_entrypoints_h but vk_common_entrypoints is not compiled in library `vulkan_lite_instance`. Rename idep_vulkan_runtime_headers to idep_vulkan_lite_runtime_headers because both lite/full runtime library depends on this, but lite should not depends on full vk_meta_private.h added into vulkan_runtime_files v6: By Yonggang Luo <luoyonggang@gmail.com> get vulkan_lite_runtime_files and vulkan_runtime_files sorted v5: By Yiwei Zhang <zzyiwei@chromium.org> both vk_sampler and vk_ycbcr_conversion can stay in the lite runtime v4: By Yonggang Luo <luoyonggang@gmail.com> only build vk_instance.(c|h) twice for reduce compiling time v3: By Yiwei Zhang <zzyiwei@chromium.org> less code changes by introduce libvulkan_lite_runtime v2: By Yonggang Luo <luoyonggang@gmail.com> allow building Vulkan without libcompiler without compiling flags, the venus is always built without libcompiler v1: By Gurchetan Singh <gurchetansingh@google.com> allow building Vulkan without libcompiler Signed-off-by: Gurchetan Singh <gurchetansingh@google.com> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26574>
2024-03-05 02:58:22 +08:00
libvulkan_lite_runtime = static_library(
'vulkan_lite_runtime',
vulkan_lite_runtime_files,
include_directories : [inc_include, inc_src],
vulkan: allow building venus without libcompiler This is done by introduce idep_vulkan_lite_runtime, and only venus depends on idep_vulkan_lite_runtime. Modify the meson and source files to allow building venus without the compiler. See details Venus build metrics at the MR description. gfxstream-vulkan forwards the shader to the host, and doesn't need to convert into NIR in the guest. This results in faster builds and less parts of Mesa to build. Also venus does the same thing too, that's what the build is keyed on right now as an in-tree user. v7: By Yonggang Luo <luoyonggang@gmail.com> Add idep_vulkan_common_entrypoints_h into vulkan_lite_runtime_deps because vk_instance.c depends on idep_vulkan_common_entrypoints_h but vk_common_entrypoints is not compiled in library `vulkan_lite_instance`. Rename idep_vulkan_runtime_headers to idep_vulkan_lite_runtime_headers because both lite/full runtime library depends on this, but lite should not depends on full vk_meta_private.h added into vulkan_runtime_files v6: By Yonggang Luo <luoyonggang@gmail.com> get vulkan_lite_runtime_files and vulkan_runtime_files sorted v5: By Yiwei Zhang <zzyiwei@chromium.org> both vk_sampler and vk_ycbcr_conversion can stay in the lite runtime v4: By Yonggang Luo <luoyonggang@gmail.com> only build vk_instance.(c|h) twice for reduce compiling time v3: By Yiwei Zhang <zzyiwei@chromium.org> less code changes by introduce libvulkan_lite_runtime v2: By Yonggang Luo <luoyonggang@gmail.com> allow building Vulkan without libcompiler without compiling flags, the venus is always built without libcompiler v1: By Gurchetan Singh <gurchetansingh@google.com> allow building Vulkan without libcompiler Signed-off-by: Gurchetan Singh <gurchetansingh@google.com> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26574>
2024-03-05 02:58:22 +08:00
dependencies : vulkan_lite_runtime_deps,
c_args : c_msvc_compat_args,
gnu_symbol_visibility : 'hidden',
build_by_default : false,
)
vulkan: allow building venus without libcompiler This is done by introduce idep_vulkan_lite_runtime, and only venus depends on idep_vulkan_lite_runtime. Modify the meson and source files to allow building venus without the compiler. See details Venus build metrics at the MR description. gfxstream-vulkan forwards the shader to the host, and doesn't need to convert into NIR in the guest. This results in faster builds and less parts of Mesa to build. Also venus does the same thing too, that's what the build is keyed on right now as an in-tree user. v7: By Yonggang Luo <luoyonggang@gmail.com> Add idep_vulkan_common_entrypoints_h into vulkan_lite_runtime_deps because vk_instance.c depends on idep_vulkan_common_entrypoints_h but vk_common_entrypoints is not compiled in library `vulkan_lite_instance`. Rename idep_vulkan_runtime_headers to idep_vulkan_lite_runtime_headers because both lite/full runtime library depends on this, but lite should not depends on full vk_meta_private.h added into vulkan_runtime_files v6: By Yonggang Luo <luoyonggang@gmail.com> get vulkan_lite_runtime_files and vulkan_runtime_files sorted v5: By Yiwei Zhang <zzyiwei@chromium.org> both vk_sampler and vk_ycbcr_conversion can stay in the lite runtime v4: By Yonggang Luo <luoyonggang@gmail.com> only build vk_instance.(c|h) twice for reduce compiling time v3: By Yiwei Zhang <zzyiwei@chromium.org> less code changes by introduce libvulkan_lite_runtime v2: By Yonggang Luo <luoyonggang@gmail.com> allow building Vulkan without libcompiler without compiling flags, the venus is always built without libcompiler v1: By Gurchetan Singh <gurchetansingh@google.com> allow building Vulkan without libcompiler Signed-off-by: Gurchetan Singh <gurchetansingh@google.com> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26574>
2024-03-05 02:58:22 +08:00
libvulkan_lite_instance = static_library(
'vulkan_lite_instance',
['vk_instance.c'],
vulkan: allow building venus without libcompiler This is done by introduce idep_vulkan_lite_runtime, and only venus depends on idep_vulkan_lite_runtime. Modify the meson and source files to allow building venus without the compiler. See details Venus build metrics at the MR description. gfxstream-vulkan forwards the shader to the host, and doesn't need to convert into NIR in the guest. This results in faster builds and less parts of Mesa to build. Also venus does the same thing too, that's what the build is keyed on right now as an in-tree user. v7: By Yonggang Luo <luoyonggang@gmail.com> Add idep_vulkan_common_entrypoints_h into vulkan_lite_runtime_deps because vk_instance.c depends on idep_vulkan_common_entrypoints_h but vk_common_entrypoints is not compiled in library `vulkan_lite_instance`. Rename idep_vulkan_runtime_headers to idep_vulkan_lite_runtime_headers because both lite/full runtime library depends on this, but lite should not depends on full vk_meta_private.h added into vulkan_runtime_files v6: By Yonggang Luo <luoyonggang@gmail.com> get vulkan_lite_runtime_files and vulkan_runtime_files sorted v5: By Yiwei Zhang <zzyiwei@chromium.org> both vk_sampler and vk_ycbcr_conversion can stay in the lite runtime v4: By Yonggang Luo <luoyonggang@gmail.com> only build vk_instance.(c|h) twice for reduce compiling time v3: By Yiwei Zhang <zzyiwei@chromium.org> less code changes by introduce libvulkan_lite_runtime v2: By Yonggang Luo <luoyonggang@gmail.com> allow building Vulkan without libcompiler without compiling flags, the venus is always built without libcompiler v1: By Gurchetan Singh <gurchetansingh@google.com> allow building Vulkan without libcompiler Signed-off-by: Gurchetan Singh <gurchetansingh@google.com> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26574>
2024-03-05 02:58:22 +08:00
include_directories : [inc_include, inc_src],
dependencies : vulkan_lite_runtime_deps,
c_args : ['-DVK_LITE_RUNTIME_INSTANCE=1', c_msvc_compat_args],
gnu_symbol_visibility : 'hidden',
build_by_default : false,
)
# The sources part is to ensure those generated headers used externally are
# indeed generated before being compiled with, as long as either one of below
# is included as a dependency:
# - idep_vulkan_lite_runtime_headers
# - idep_vulkan_lite_runtime
# - idep_vulkan_runtime_headers
# - idep_vulkan_runtime
vulkan: allow building venus without libcompiler This is done by introduce idep_vulkan_lite_runtime, and only venus depends on idep_vulkan_lite_runtime. Modify the meson and source files to allow building venus without the compiler. See details Venus build metrics at the MR description. gfxstream-vulkan forwards the shader to the host, and doesn't need to convert into NIR in the guest. This results in faster builds and less parts of Mesa to build. Also venus does the same thing too, that's what the build is keyed on right now as an in-tree user. v7: By Yonggang Luo <luoyonggang@gmail.com> Add idep_vulkan_common_entrypoints_h into vulkan_lite_runtime_deps because vk_instance.c depends on idep_vulkan_common_entrypoints_h but vk_common_entrypoints is not compiled in library `vulkan_lite_instance`. Rename idep_vulkan_runtime_headers to idep_vulkan_lite_runtime_headers because both lite/full runtime library depends on this, but lite should not depends on full vk_meta_private.h added into vulkan_runtime_files v6: By Yonggang Luo <luoyonggang@gmail.com> get vulkan_lite_runtime_files and vulkan_runtime_files sorted v5: By Yiwei Zhang <zzyiwei@chromium.org> both vk_sampler and vk_ycbcr_conversion can stay in the lite runtime v4: By Yonggang Luo <luoyonggang@gmail.com> only build vk_instance.(c|h) twice for reduce compiling time v3: By Yiwei Zhang <zzyiwei@chromium.org> less code changes by introduce libvulkan_lite_runtime v2: By Yonggang Luo <luoyonggang@gmail.com> allow building Vulkan without libcompiler without compiling flags, the venus is always built without libcompiler v1: By Gurchetan Singh <gurchetansingh@google.com> allow building Vulkan without libcompiler Signed-off-by: Gurchetan Singh <gurchetansingh@google.com> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26574>
2024-03-05 02:58:22 +08:00
idep_vulkan_lite_runtime_headers = declare_dependency(
sources : [
spirv_info_h,
vk_cmd_enqueue_entrypoints[0],
vk_cmd_queue[1],
vk_common_entrypoints[0],
vk_physical_device_features[1],
vk_physical_device_properties[1],
],
vulkan: allow building venus without libcompiler This is done by introduce idep_vulkan_lite_runtime, and only venus depends on idep_vulkan_lite_runtime. Modify the meson and source files to allow building venus without the compiler. See details Venus build metrics at the MR description. gfxstream-vulkan forwards the shader to the host, and doesn't need to convert into NIR in the guest. This results in faster builds and less parts of Mesa to build. Also venus does the same thing too, that's what the build is keyed on right now as an in-tree user. v7: By Yonggang Luo <luoyonggang@gmail.com> Add idep_vulkan_common_entrypoints_h into vulkan_lite_runtime_deps because vk_instance.c depends on idep_vulkan_common_entrypoints_h but vk_common_entrypoints is not compiled in library `vulkan_lite_instance`. Rename idep_vulkan_runtime_headers to idep_vulkan_lite_runtime_headers because both lite/full runtime library depends on this, but lite should not depends on full vk_meta_private.h added into vulkan_runtime_files v6: By Yonggang Luo <luoyonggang@gmail.com> get vulkan_lite_runtime_files and vulkan_runtime_files sorted v5: By Yiwei Zhang <zzyiwei@chromium.org> both vk_sampler and vk_ycbcr_conversion can stay in the lite runtime v4: By Yonggang Luo <luoyonggang@gmail.com> only build vk_instance.(c|h) twice for reduce compiling time v3: By Yiwei Zhang <zzyiwei@chromium.org> less code changes by introduce libvulkan_lite_runtime v2: By Yonggang Luo <luoyonggang@gmail.com> allow building Vulkan without libcompiler without compiling flags, the venus is always built without libcompiler v1: By Gurchetan Singh <gurchetansingh@google.com> allow building Vulkan without libcompiler Signed-off-by: Gurchetan Singh <gurchetansingh@google.com> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26574>
2024-03-05 02:58:22 +08:00
include_directories : include_directories('.'),
)
# This is likely a bug in the Meson VS backend, as MSVC with ninja works fine.
# See this discussion here:
# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10506
if get_option('backend').startswith('vs')
vulkan: allow building venus without libcompiler This is done by introduce idep_vulkan_lite_runtime, and only venus depends on idep_vulkan_lite_runtime. Modify the meson and source files to allow building venus without the compiler. See details Venus build metrics at the MR description. gfxstream-vulkan forwards the shader to the host, and doesn't need to convert into NIR in the guest. This results in faster builds and less parts of Mesa to build. Also venus does the same thing too, that's what the build is keyed on right now as an in-tree user. v7: By Yonggang Luo <luoyonggang@gmail.com> Add idep_vulkan_common_entrypoints_h into vulkan_lite_runtime_deps because vk_instance.c depends on idep_vulkan_common_entrypoints_h but vk_common_entrypoints is not compiled in library `vulkan_lite_instance`. Rename idep_vulkan_runtime_headers to idep_vulkan_lite_runtime_headers because both lite/full runtime library depends on this, but lite should not depends on full vk_meta_private.h added into vulkan_runtime_files v6: By Yonggang Luo <luoyonggang@gmail.com> get vulkan_lite_runtime_files and vulkan_runtime_files sorted v5: By Yiwei Zhang <zzyiwei@chromium.org> both vk_sampler and vk_ycbcr_conversion can stay in the lite runtime v4: By Yonggang Luo <luoyonggang@gmail.com> only build vk_instance.(c|h) twice for reduce compiling time v3: By Yiwei Zhang <zzyiwei@chromium.org> less code changes by introduce libvulkan_lite_runtime v2: By Yonggang Luo <luoyonggang@gmail.com> allow building Vulkan without libcompiler without compiling flags, the venus is always built without libcompiler v1: By Gurchetan Singh <gurchetansingh@google.com> allow building Vulkan without libcompiler Signed-off-by: Gurchetan Singh <gurchetansingh@google.com> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26574>
2024-03-05 02:58:22 +08:00
idep_vulkan_lite_runtime = declare_dependency(
link_with : [libvulkan_lite_runtime, libvulkan_lite_instance],
dependencies : idep_vulkan_lite_runtime_headers
)
else
vulkan: allow building venus without libcompiler This is done by introduce idep_vulkan_lite_runtime, and only venus depends on idep_vulkan_lite_runtime. Modify the meson and source files to allow building venus without the compiler. See details Venus build metrics at the MR description. gfxstream-vulkan forwards the shader to the host, and doesn't need to convert into NIR in the guest. This results in faster builds and less parts of Mesa to build. Also venus does the same thing too, that's what the build is keyed on right now as an in-tree user. v7: By Yonggang Luo <luoyonggang@gmail.com> Add idep_vulkan_common_entrypoints_h into vulkan_lite_runtime_deps because vk_instance.c depends on idep_vulkan_common_entrypoints_h but vk_common_entrypoints is not compiled in library `vulkan_lite_instance`. Rename idep_vulkan_runtime_headers to idep_vulkan_lite_runtime_headers because both lite/full runtime library depends on this, but lite should not depends on full vk_meta_private.h added into vulkan_runtime_files v6: By Yonggang Luo <luoyonggang@gmail.com> get vulkan_lite_runtime_files and vulkan_runtime_files sorted v5: By Yiwei Zhang <zzyiwei@chromium.org> both vk_sampler and vk_ycbcr_conversion can stay in the lite runtime v4: By Yonggang Luo <luoyonggang@gmail.com> only build vk_instance.(c|h) twice for reduce compiling time v3: By Yiwei Zhang <zzyiwei@chromium.org> less code changes by introduce libvulkan_lite_runtime v2: By Yonggang Luo <luoyonggang@gmail.com> allow building Vulkan without libcompiler without compiling flags, the venus is always built without libcompiler v1: By Gurchetan Singh <gurchetansingh@google.com> allow building Vulkan without libcompiler Signed-off-by: Gurchetan Singh <gurchetansingh@google.com> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26574>
2024-03-05 02:58:22 +08:00
idep_vulkan_lite_runtime = declare_dependency(
# Instruct users of this library to link with --whole-archive. Otherwise,
# our weak function overloads may not resolve properly.
vulkan: allow building venus without libcompiler This is done by introduce idep_vulkan_lite_runtime, and only venus depends on idep_vulkan_lite_runtime. Modify the meson and source files to allow building venus without the compiler. See details Venus build metrics at the MR description. gfxstream-vulkan forwards the shader to the host, and doesn't need to convert into NIR in the guest. This results in faster builds and less parts of Mesa to build. Also venus does the same thing too, that's what the build is keyed on right now as an in-tree user. v7: By Yonggang Luo <luoyonggang@gmail.com> Add idep_vulkan_common_entrypoints_h into vulkan_lite_runtime_deps because vk_instance.c depends on idep_vulkan_common_entrypoints_h but vk_common_entrypoints is not compiled in library `vulkan_lite_instance`. Rename idep_vulkan_runtime_headers to idep_vulkan_lite_runtime_headers because both lite/full runtime library depends on this, but lite should not depends on full vk_meta_private.h added into vulkan_runtime_files v6: By Yonggang Luo <luoyonggang@gmail.com> get vulkan_lite_runtime_files and vulkan_runtime_files sorted v5: By Yiwei Zhang <zzyiwei@chromium.org> both vk_sampler and vk_ycbcr_conversion can stay in the lite runtime v4: By Yonggang Luo <luoyonggang@gmail.com> only build vk_instance.(c|h) twice for reduce compiling time v3: By Yiwei Zhang <zzyiwei@chromium.org> less code changes by introduce libvulkan_lite_runtime v2: By Yonggang Luo <luoyonggang@gmail.com> allow building Vulkan without libcompiler without compiling flags, the venus is always built without libcompiler v1: By Gurchetan Singh <gurchetansingh@google.com> allow building Vulkan without libcompiler Signed-off-by: Gurchetan Singh <gurchetansingh@google.com> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26574>
2024-03-05 02:58:22 +08:00
link_whole : [libvulkan_lite_runtime, libvulkan_lite_instance],
dependencies : idep_vulkan_lite_runtime_headers
)
endif
vulkan_runtime_files = files(
'vk_meta.c',
'vk_meta_blit_resolve.c',
'vk_meta_clear.c',
vk/meta: Add copy/fill/update helpers Add buffer copy/fill/update helpers using compute shaders. The driver can select the optimal per-workgroup copy/fill/update size by specifying a non-zero vk_meta_device::buffer_access::optimal_size_per_wg size. If zero, the core will assume a 64-byte size (the usual cache-line size). Buffer accesses will be done through SSBOs unless vk_meta_device::buffer_access::use_global_address is true, in which case the core will the buffer address using GetBufferDeviceAddress() and pass that address as a push constant to the compute shader. Image to buffer copies are always done through a compute shader. The optimal workgroup size will be chosen based on vk_meta_copy_image_properties::tile_size: the copy logic picks a workgroup size matching the tile size, and aligns accesses on a tile. The view format is selected by the driver. To optimize things on the shader side, pick UINT formats (usually less work to do to pack data). Buffer to image copies can be done done through the graphics pipeline if needed (use_gfx_pipeline passed to vk_meta_copy_buffer_to_image()), which is useful for vendor-specific compressed formats that can't be written outside of the graphics pipeline. Drivers should normally prefer compute-based copies when that's an option. Just like for image to buffer copies, the workgroup size of compute shaders is picked based on the image tile size, and the view format must be selected by the driver. Image to image copies is just a mix of the above, with the driver being able to select the pipeline type, as well as define the tile size and view format to use. When using a compute pipeline, the workgroup size will be MAX2(src_tile_sz, dst_tile_sz), and accesses will be aligned on the selected reference image. For compressed formats, the caller should pick an RGBA format matching the compressed block size. Co-developed-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29333>
2024-05-22 18:37:02 +02:00
'vk_meta_copy_fill_update.c',
vulkan: allow building venus without libcompiler This is done by introduce idep_vulkan_lite_runtime, and only venus depends on idep_vulkan_lite_runtime. Modify the meson and source files to allow building venus without the compiler. See details Venus build metrics at the MR description. gfxstream-vulkan forwards the shader to the host, and doesn't need to convert into NIR in the guest. This results in faster builds and less parts of Mesa to build. Also venus does the same thing too, that's what the build is keyed on right now as an in-tree user. v7: By Yonggang Luo <luoyonggang@gmail.com> Add idep_vulkan_common_entrypoints_h into vulkan_lite_runtime_deps because vk_instance.c depends on idep_vulkan_common_entrypoints_h but vk_common_entrypoints is not compiled in library `vulkan_lite_instance`. Rename idep_vulkan_runtime_headers to idep_vulkan_lite_runtime_headers because both lite/full runtime library depends on this, but lite should not depends on full vk_meta_private.h added into vulkan_runtime_files v6: By Yonggang Luo <luoyonggang@gmail.com> get vulkan_lite_runtime_files and vulkan_runtime_files sorted v5: By Yiwei Zhang <zzyiwei@chromium.org> both vk_sampler and vk_ycbcr_conversion can stay in the lite runtime v4: By Yonggang Luo <luoyonggang@gmail.com> only build vk_instance.(c|h) twice for reduce compiling time v3: By Yiwei Zhang <zzyiwei@chromium.org> less code changes by introduce libvulkan_lite_runtime v2: By Yonggang Luo <luoyonggang@gmail.com> allow building Vulkan without libcompiler without compiling flags, the venus is always built without libcompiler v1: By Gurchetan Singh <gurchetansingh@google.com> allow building Vulkan without libcompiler Signed-off-by: Gurchetan Singh <gurchetansingh@google.com> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26574>
2024-03-05 02:58:22 +08:00
'vk_meta_draw_rects.c',
'vk_nir.c',
'vk_nir_convert_ycbcr.c',
'vk_pipeline.c',
'vk_pipeline_cache.c',
'vk_shader.c',
'vk_shader_module.c',
'vk_texcompress_etc2.c',
)
vulkan_runtime_deps = [
vulkan_lite_runtime_deps,
idep_nir,
idep_vtn,
]
if prog_glslang.found()
subdir('radix_sort')
subdir('bvh')
vulkan_runtime_files += files('vk_texcompress_astc.c')
vulkan: allow building venus without libcompiler This is done by introduce idep_vulkan_lite_runtime, and only venus depends on idep_vulkan_lite_runtime. Modify the meson and source files to allow building venus without the compiler. See details Venus build metrics at the MR description. gfxstream-vulkan forwards the shader to the host, and doesn't need to convert into NIR in the guest. This results in faster builds and less parts of Mesa to build. Also venus does the same thing too, that's what the build is keyed on right now as an in-tree user. v7: By Yonggang Luo <luoyonggang@gmail.com> Add idep_vulkan_common_entrypoints_h into vulkan_lite_runtime_deps because vk_instance.c depends on idep_vulkan_common_entrypoints_h but vk_common_entrypoints is not compiled in library `vulkan_lite_instance`. Rename idep_vulkan_runtime_headers to idep_vulkan_lite_runtime_headers because both lite/full runtime library depends on this, but lite should not depends on full vk_meta_private.h added into vulkan_runtime_files v6: By Yonggang Luo <luoyonggang@gmail.com> get vulkan_lite_runtime_files and vulkan_runtime_files sorted v5: By Yiwei Zhang <zzyiwei@chromium.org> both vk_sampler and vk_ycbcr_conversion can stay in the lite runtime v4: By Yonggang Luo <luoyonggang@gmail.com> only build vk_instance.(c|h) twice for reduce compiling time v3: By Yiwei Zhang <zzyiwei@chromium.org> less code changes by introduce libvulkan_lite_runtime v2: By Yonggang Luo <luoyonggang@gmail.com> allow building Vulkan without libcompiler without compiling flags, the venus is always built without libcompiler v1: By Gurchetan Singh <gurchetansingh@google.com> allow building Vulkan without libcompiler Signed-off-by: Gurchetan Singh <gurchetansingh@google.com> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26574>
2024-03-05 02:58:22 +08:00
vulkan_runtime_files += custom_target(
'astc_spv.h',
input : astc_decoder_glsl_file,
output : 'astc_spv.h',
command : [
prog_glslang, '-V', '-S', 'comp', '-x', '-o', '@OUTPUT@', '@INPUT@',
glslang_quiet, glslang_depfile,
],
depfile : 'astc_spv.h.d',
vulkan: allow building venus without libcompiler This is done by introduce idep_vulkan_lite_runtime, and only venus depends on idep_vulkan_lite_runtime. Modify the meson and source files to allow building venus without the compiler. See details Venus build metrics at the MR description. gfxstream-vulkan forwards the shader to the host, and doesn't need to convert into NIR in the guest. This results in faster builds and less parts of Mesa to build. Also venus does the same thing too, that's what the build is keyed on right now as an in-tree user. v7: By Yonggang Luo <luoyonggang@gmail.com> Add idep_vulkan_common_entrypoints_h into vulkan_lite_runtime_deps because vk_instance.c depends on idep_vulkan_common_entrypoints_h but vk_common_entrypoints is not compiled in library `vulkan_lite_instance`. Rename idep_vulkan_runtime_headers to idep_vulkan_lite_runtime_headers because both lite/full runtime library depends on this, but lite should not depends on full vk_meta_private.h added into vulkan_runtime_files v6: By Yonggang Luo <luoyonggang@gmail.com> get vulkan_lite_runtime_files and vulkan_runtime_files sorted v5: By Yiwei Zhang <zzyiwei@chromium.org> both vk_sampler and vk_ycbcr_conversion can stay in the lite runtime v4: By Yonggang Luo <luoyonggang@gmail.com> only build vk_instance.(c|h) twice for reduce compiling time v3: By Yiwei Zhang <zzyiwei@chromium.org> less code changes by introduce libvulkan_lite_runtime v2: By Yonggang Luo <luoyonggang@gmail.com> allow building Vulkan without libcompiler without compiling flags, the venus is always built without libcompiler v1: By Gurchetan Singh <gurchetansingh@google.com> allow building Vulkan without libcompiler Signed-off-by: Gurchetan Singh <gurchetansingh@google.com> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26574>
2024-03-05 02:58:22 +08:00
)
vulkan_runtime_files += files('vk_acceleration_structure.c')
vulkan_runtime_files += radix_sort_files
vulkan_runtime_files += bvh_spv
vulkan_runtime_files += radix_sort_spv
vulkan: allow building venus without libcompiler This is done by introduce idep_vulkan_lite_runtime, and only venus depends on idep_vulkan_lite_runtime. Modify the meson and source files to allow building venus without the compiler. See details Venus build metrics at the MR description. gfxstream-vulkan forwards the shader to the host, and doesn't need to convert into NIR in the guest. This results in faster builds and less parts of Mesa to build. Also venus does the same thing too, that's what the build is keyed on right now as an in-tree user. v7: By Yonggang Luo <luoyonggang@gmail.com> Add idep_vulkan_common_entrypoints_h into vulkan_lite_runtime_deps because vk_instance.c depends on idep_vulkan_common_entrypoints_h but vk_common_entrypoints is not compiled in library `vulkan_lite_instance`. Rename idep_vulkan_runtime_headers to idep_vulkan_lite_runtime_headers because both lite/full runtime library depends on this, but lite should not depends on full vk_meta_private.h added into vulkan_runtime_files v6: By Yonggang Luo <luoyonggang@gmail.com> get vulkan_lite_runtime_files and vulkan_runtime_files sorted v5: By Yiwei Zhang <zzyiwei@chromium.org> both vk_sampler and vk_ycbcr_conversion can stay in the lite runtime v4: By Yonggang Luo <luoyonggang@gmail.com> only build vk_instance.(c|h) twice for reduce compiling time v3: By Yiwei Zhang <zzyiwei@chromium.org> less code changes by introduce libvulkan_lite_runtime v2: By Yonggang Luo <luoyonggang@gmail.com> allow building Vulkan without libcompiler without compiling flags, the venus is always built without libcompiler v1: By Gurchetan Singh <gurchetansingh@google.com> allow building Vulkan without libcompiler Signed-off-by: Gurchetan Singh <gurchetansingh@google.com> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26574>
2024-03-05 02:58:22 +08:00
endif
libvulkan_runtime = static_library(
'vulkan_runtime',
[vulkan_runtime_files],
include_directories : [inc_include, inc_src],
dependencies : vulkan_runtime_deps,
c_args : c_msvc_compat_args,
gnu_symbol_visibility : 'hidden',
build_by_default : false,
)
libvulkan_instance = static_library(
'vulkan_instance',
['vk_instance.c'],
vulkan: allow building venus without libcompiler This is done by introduce idep_vulkan_lite_runtime, and only venus depends on idep_vulkan_lite_runtime. Modify the meson and source files to allow building venus without the compiler. See details Venus build metrics at the MR description. gfxstream-vulkan forwards the shader to the host, and doesn't need to convert into NIR in the guest. This results in faster builds and less parts of Mesa to build. Also venus does the same thing too, that's what the build is keyed on right now as an in-tree user. v7: By Yonggang Luo <luoyonggang@gmail.com> Add idep_vulkan_common_entrypoints_h into vulkan_lite_runtime_deps because vk_instance.c depends on idep_vulkan_common_entrypoints_h but vk_common_entrypoints is not compiled in library `vulkan_lite_instance`. Rename idep_vulkan_runtime_headers to idep_vulkan_lite_runtime_headers because both lite/full runtime library depends on this, but lite should not depends on full vk_meta_private.h added into vulkan_runtime_files v6: By Yonggang Luo <luoyonggang@gmail.com> get vulkan_lite_runtime_files and vulkan_runtime_files sorted v5: By Yiwei Zhang <zzyiwei@chromium.org> both vk_sampler and vk_ycbcr_conversion can stay in the lite runtime v4: By Yonggang Luo <luoyonggang@gmail.com> only build vk_instance.(c|h) twice for reduce compiling time v3: By Yiwei Zhang <zzyiwei@chromium.org> less code changes by introduce libvulkan_lite_runtime v2: By Yonggang Luo <luoyonggang@gmail.com> allow building Vulkan without libcompiler without compiling flags, the venus is always built without libcompiler v1: By Gurchetan Singh <gurchetansingh@google.com> allow building Vulkan without libcompiler Signed-off-by: Gurchetan Singh <gurchetansingh@google.com> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26574>
2024-03-05 02:58:22 +08:00
include_directories : [inc_include, inc_src],
dependencies : vulkan_runtime_deps,
c_args : ['-DVK_LITE_RUNTIME_INSTANCE=0', c_msvc_compat_args],
gnu_symbol_visibility : 'hidden',
build_by_default : false,
)
if get_option('backend').startswith('vs')
idep_vulkan_runtime_body = declare_dependency(
link_with : [libvulkan_lite_runtime, libvulkan_runtime, libvulkan_instance],
)
else
idep_vulkan_runtime_body = declare_dependency(
link_whole : [libvulkan_lite_runtime, libvulkan_runtime, libvulkan_instance],
)
endif
vulkan: allow building venus without libcompiler This is done by introduce idep_vulkan_lite_runtime, and only venus depends on idep_vulkan_lite_runtime. Modify the meson and source files to allow building venus without the compiler. See details Venus build metrics at the MR description. gfxstream-vulkan forwards the shader to the host, and doesn't need to convert into NIR in the guest. This results in faster builds and less parts of Mesa to build. Also venus does the same thing too, that's what the build is keyed on right now as an in-tree user. v7: By Yonggang Luo <luoyonggang@gmail.com> Add idep_vulkan_common_entrypoints_h into vulkan_lite_runtime_deps because vk_instance.c depends on idep_vulkan_common_entrypoints_h but vk_common_entrypoints is not compiled in library `vulkan_lite_instance`. Rename idep_vulkan_runtime_headers to idep_vulkan_lite_runtime_headers because both lite/full runtime library depends on this, but lite should not depends on full vk_meta_private.h added into vulkan_runtime_files v6: By Yonggang Luo <luoyonggang@gmail.com> get vulkan_lite_runtime_files and vulkan_runtime_files sorted v5: By Yiwei Zhang <zzyiwei@chromium.org> both vk_sampler and vk_ycbcr_conversion can stay in the lite runtime v4: By Yonggang Luo <luoyonggang@gmail.com> only build vk_instance.(c|h) twice for reduce compiling time v3: By Yiwei Zhang <zzyiwei@chromium.org> less code changes by introduce libvulkan_lite_runtime v2: By Yonggang Luo <luoyonggang@gmail.com> allow building Vulkan without libcompiler without compiling flags, the venus is always built without libcompiler v1: By Gurchetan Singh <gurchetansingh@google.com> allow building Vulkan without libcompiler Signed-off-by: Gurchetan Singh <gurchetansingh@google.com> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26574>
2024-03-05 02:58:22 +08:00
idep_vulkan_runtime_headers = [idep_vulkan_lite_runtime_headers]
idep_vulkan_runtime_headers += declare_dependency(
include_directories : include_directories('bvh'),
)
vulkan: allow building venus without libcompiler This is done by introduce idep_vulkan_lite_runtime, and only venus depends on idep_vulkan_lite_runtime. Modify the meson and source files to allow building venus without the compiler. See details Venus build metrics at the MR description. gfxstream-vulkan forwards the shader to the host, and doesn't need to convert into NIR in the guest. This results in faster builds and less parts of Mesa to build. Also venus does the same thing too, that's what the build is keyed on right now as an in-tree user. v7: By Yonggang Luo <luoyonggang@gmail.com> Add idep_vulkan_common_entrypoints_h into vulkan_lite_runtime_deps because vk_instance.c depends on idep_vulkan_common_entrypoints_h but vk_common_entrypoints is not compiled in library `vulkan_lite_instance`. Rename idep_vulkan_runtime_headers to idep_vulkan_lite_runtime_headers because both lite/full runtime library depends on this, but lite should not depends on full vk_meta_private.h added into vulkan_runtime_files v6: By Yonggang Luo <luoyonggang@gmail.com> get vulkan_lite_runtime_files and vulkan_runtime_files sorted v5: By Yiwei Zhang <zzyiwei@chromium.org> both vk_sampler and vk_ycbcr_conversion can stay in the lite runtime v4: By Yonggang Luo <luoyonggang@gmail.com> only build vk_instance.(c|h) twice for reduce compiling time v3: By Yiwei Zhang <zzyiwei@chromium.org> less code changes by introduce libvulkan_lite_runtime v2: By Yonggang Luo <luoyonggang@gmail.com> allow building Vulkan without libcompiler without compiling flags, the venus is always built without libcompiler v1: By Gurchetan Singh <gurchetansingh@google.com> allow building Vulkan without libcompiler Signed-off-by: Gurchetan Singh <gurchetansingh@google.com> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26574>
2024-03-05 02:58:22 +08:00
idep_vulkan_runtime = declare_dependency(
dependencies : [
idep_vulkan_runtime_headers,
idep_vulkan_runtime_body,
]
)