vulkan, radv: Support backslash in ICD paths

Vulkan loader wants backslash for paths on Windows. Need to jump through
hoops because Meson does not support backslashes in commands.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13461>
This commit is contained in:
James Park 2021-10-20 14:42:32 -07:00 committed by Marge Bot
parent 379fab74d2
commit 183e705a15
2 changed files with 18 additions and 7 deletions

View File

@ -190,16 +190,21 @@ if with_platform_windows
icd_file_name = 'vulkan_radeon.dll'
endif
icd_command = [
prog_python, '@INPUT0@',
'--api-version', '1.2', '--xml', '@INPUT1@',
'--lib-path', join_paths(icd_lib_path, icd_file_name),
'--out', '@OUTPUT@',
]
if with_platform_windows
icd_command += '--use-backslash'
endif
radeon_icd = custom_target(
'radeon_icd',
input : [vk_icd_gen, vk_api_xml],
output : 'radeon_icd.@0@.json'.format(host_machine.cpu()),
command : [
prog_python, '@INPUT0@',
'--api-version', '1.2', '--xml', '@INPUT1@',
'--lib-path', join_paths(icd_lib_path, icd_file_name),
'--out', '@OUTPUT@',
],
command : icd_command,
build_by_default : true,
install_dir : with_vulkan_icd_dir,
install : true,

View File

@ -48,6 +48,8 @@ if __name__ == '__main__':
help='Path to installed library')
parser.add_argument('--out', required=False,
help='Output json file.')
parser.add_argument('--use-backslash', action='store_true',
help='Use backslash (Windows).')
args = parser.parse_args()
version = args.api_version
@ -57,10 +59,14 @@ if __name__ == '__main__':
else:
re.match(r'\d+\.\d+\.\d+', version)
lib_path = args.lib_path
if args.use_backslash:
lib_path = lib_path.replace('/', '\\')
json_data = {
'file_format_version': '1.0.0',
'ICD': {
'library_path': args.lib_path,
'library_path': lib_path,
'api_version': version,
},
}