From ff30b059173164373747d47548d1b7eb7ba01044 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Mon, 30 Jan 2023 20:12:03 -0600 Subject: [PATCH] nvk: Add a devenv ICD json file This also reworks the ICD generation stuff based on the radv header Part-of: --- src/nouveau/vulkan/meson.build | 56 ++++++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 16 deletions(-) diff --git a/src/nouveau/vulkan/meson.build b/src/nouveau/vulkan/meson.build index c04cc1e882a..819979981dc 100644 --- a/src/nouveau/vulkan/meson.build +++ b/src/nouveau/vulkan/meson.build @@ -60,22 +60,6 @@ nvk_files = files( 'nvk_wsi.h' ) -nouveau_icd = custom_target( - 'nouveau_icd', - input : [vk_icd_gen, vk_api_xml], - output : 'nouveau_icd.@0@.json'.format(host_machine.cpu()), - command : [ - prog_python, '@INPUT0@', - '--api-version', '1.3', '--xml', '@INPUT1@', - '--lib-path', join_paths(get_option('prefix'), get_option('libdir'), - 'libvulkan_nouveau.so'), - '--out', '@OUTPUT@', - ], - build_by_default : true, - install_dir : with_vulkan_icd_dir, - install : true, -) - nvk_entrypoints = custom_target( 'nvk_entrypoints', input : [vk_entrypoints_gen, vk_api_xml], @@ -119,3 +103,43 @@ libvulkan_nouveau = shared_library( gnu_symbol_visibility : 'hidden', install : true, ) + +icd_lib_path = join_paths(get_option('prefix'), get_option('libdir')) +icd_file_name = 'libvulkan_nouveau.so' +if with_platform_windows + icd_lib_path = join_paths(get_option('prefix'), get_option('bindir')) + icd_file_name = 'vulkan_nouveau.dll' +endif + +nouveau_icd = custom_target( + 'nouveau_icd', + input : [vk_icd_gen, vk_api_xml], + output : 'nouveau_icd.@0@.json'.format(host_machine.cpu()), + command : [ + prog_python, '@INPUT0@', + '--api-version', '1.3', '--xml', '@INPUT1@', + '--lib-path', join_paths(icd_lib_path, icd_file_name), + '--out', '@OUTPUT@', + ], + build_by_default : true, + install_dir : with_vulkan_icd_dir, + install : true, +) + +if meson.version().version_compare('>= 0.58') + _dev_icdname = 'nouveau_devenv_icd.@0@.json'.format(host_machine.cpu()) + custom_target( + 'nouveau_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() / icd_file_name, + '--out', '@OUTPUT@', + ], + build_by_default : true, + ) + + devenv.append('VK_ICD_FILENAMES', meson.current_build_dir() / _dev_icdname) +endif