From 8d7b56f68c95b493a2c1d03a4b847bf5059ea16b Mon Sep 17 00:00:00 2001 From: Ikey Doherty Date: Mon, 13 Nov 2017 02:14:54 +0000 Subject: [PATCH] shim: Get ready for the new Vulkan snapd changes Signed-off-by: Ikey Doherty --- src/shim/shim.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/shim/shim.c b/src/shim/shim.c index a89fb3f..ae005d1 100644 --- a/src/shim/shim.c +++ b/src/shim/shim.c @@ -45,9 +45,10 @@ #define REDIRECT_PATH "/usr/\$LIB/liblsi-redirect.so" /** - * Bi-arch location for the host Vulkan ICD files + * Potential for the host Vulkan ICD files (old vs new) */ -#define VK_GLOB_BIARCH "/var/lib/snapd/lib/gl/10_*.json" +#define VK_GLOB "/var/lib/snapd/lib/gl/10_*.json" +#define VK_GLOB_2 "/var/lib/snapd/lib/vulkan/10_*.json" /** * Used to update a value in the environment, and perform a prepend if the variable @@ -238,8 +239,10 @@ static void shim_export_extra(const char *prefix) shim_export_merge_vars("PATH", prefix, "/usr/bin"); shim_export_merge_vars("PATH", prefix, "/bin"); - /* TODO: If this fails, try setting from multiarch */ - shim_init_vulkan(VK_GLOB_BIARCH); + /* Try both known Vulkan ICD paths */ + if (!shim_init_vulkan(VK_GLOB_2)) { + shim_init_vulkan(VK_GLOB); + } /* XDG */ shim_export_merge_vars("XDG_CONFIG_DIRS", NULL, "/etc/xdg");