aboutsummaryrefslogtreecommitdiff
path: root/loader
diff options
context:
space:
mode:
authorMark Young <marky@lunarg.com>2016-09-06 09:53:45 -0600
committerMark Young <marky@lunarg.com>2016-09-06 10:36:22 -0600
commit191459c4b7bd009a2c02aaa90434d1540391e1d9 (patch)
tree71413407e6d8b58e86f2b15417b318f79a457c97 /loader
parentd7c4ce34a6b4d28ec9cef07c7c78411965ec8d6e (diff)
downloadusermoji-191459c4b7bd009a2c02aaa90434d1540391e1d9.tar.xz
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
Diffstat (limited to 'loader')
-rw-r--r--loader/loader.c13
1 files changed, 10 insertions, 3 deletions
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;
}