From f1392431e0ba00fb749f56bc65d5a9e7791385f0 Mon Sep 17 00:00:00 2001 From: Gurchetan Singh Date: Fri, 15 Mar 2024 12:52:02 -0700 Subject: [PATCH] gfxstream: generate development ICD for meson build An user is now able to do: export VK_ICD_FILENAMES=./amd64-build/guest/vulkan/gfxstream_vk_devenv_icd.x86_64.json that allows vulkan apps without install the ICD. If built with option `-Dgfxstream-build=guest-test`, that would go into the gfxstream VK ICD and the test layer. Unfortunately, the test layer hangs right now since I believe the gfxstream_backend's vulkan loading logic is also affected by the environment variable. Reviewed-by: Aaron Ruby Acked-by: Yonggang Luo Acked-by: Adam Jackson Part-of: --- src/gfxstream/guest/vulkan/meson.build | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/gfxstream/guest/vulkan/meson.build b/src/gfxstream/guest/vulkan/meson.build index e67d70444a4..9045eef0ab1 100644 --- a/src/gfxstream/guest/vulkan/meson.build +++ b/src/gfxstream/guest/vulkan/meson.build @@ -27,9 +27,9 @@ lib_vulkan_gfxstream = shared_library( ) gfxstream_icd = custom_target( - 'gfxstream_icd', + 'gfxstream_vk_icd', input : [vk_icd_gen, vk_api_xml], - output : 'gfxstream_icd.@0@.json'.format(host_machine.cpu()), + output : 'gfxstream_vk_icd.@0@.json'.format(host_machine.cpu()), command : [ prog_python, '@INPUT0@', '--api-version', '1.1', '--xml', '@INPUT1@', @@ -41,3 +41,19 @@ gfxstream_icd = custom_target( install_dir : with_vulkan_icd_dir, install : true, ) + +_dev_icdname = 'gfxstream_vk_devenv_icd.@0@.json'.format(host_machine.cpu()) +_dev_icd = custom_target( + 'gfxstream_vk_devenv_icd', + input : [vk_icd_gen, vk_api_xml], + output : _dev_icdname, + command : [ + prog_python, '@INPUT0@', + '--api-version', '1.3', '--xml', '@INPUT1@', + '--lib-path', meson.current_build_dir() / 'libvulkan_gfxstream.so', + '--out', '@OUTPUT@', + ], + build_by_default : true, +) + +devenv.append('VK_ICD_FILENAMES', _dev_icd.full_path())