From 191459c4b7bd009a2c02aaa90434d1540391e1d9 Mon Sep 17 00:00:00 2001 From: Mark Young Date: Tue, 6 Sep 2016 09:53:45 -0600 Subject: loader: gh901 Fix loader w multiple ICDs When an ICD failed during CreateInstance time, the loader needs to remove the ICD from the list of available ICDs. Change-Id: Id27a971e401ec9475b9488bdd95298e0f509f6b7 --- loader/loader.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'loader') diff --git a/loader/loader.c b/loader/loader.c index 825d2b01..98b96866 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -4121,7 +4121,10 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateInstance( // If out of memory, bail immediately. goto out; } else if (VK_SUCCESS != res) { - // Keep trying if there was some other error. + // Something bad happened with this ICD, so free it and try the + // next. + ptr_instance->icds = icd->next; + loader_icd_destroy(ptr_instance, icd, pAllocator); continue; } @@ -4133,7 +4136,10 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateInstance( // If out of memory, bail immediately. goto out; } else if (VK_SUCCESS != res) { - // Keep trying if there was some other error. + // Something bad happened with this ICD, so free it and try the + // next. + ptr_instance->icds = icd->next; + loader_icd_destroy(ptr_instance, icd, pAllocator); continue; } @@ -4157,9 +4163,10 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateInstance( // If out of memory, bail immediately. goto out; } else if (VK_SUCCESS != res) { - // Keep trying if there was some other error. loader_log(ptr_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, "ICD ignored: failed to CreateInstance in ICD %d", i); + ptr_instance->icds = icd->next; + loader_icd_destroy(ptr_instance, icd, pAllocator); continue; } -- cgit v1.2.3