struct loader_instance {
struct loader_icd *icds;
struct loader_instance *next;
+ uint32_t extension_count;
+ char **extension_names;
};
struct loader_layers {
struct loader_scanned_icds *scanned_icds;
struct loader_icd *icd;
VkResult res = VK_ERROR_INITIALIZATION_FAILED;
+ uint32_t i;
/* Scan/discover all ICD libraries in a single-threaded manner */
loader_platform_thread_once(&once_icd, loader_icd_scan);
return VK_ERROR_OUT_OF_MEMORY;
}
memset(ptr_instance, 0, sizeof(struct loader_instance));
-
+ ptr_instance->extension_count = pCreateInfo->extensionCount;
+ ptr_instance->extension_names = (ptr_instance->extension_count > 0) ?
+ malloc(sizeof (char *) * ptr_instance->extension_count) : NULL;
+ for (i = 0; i < ptr_instance->extension_count; i++) {
+ ptr_instance->extension_names[i] = malloc(strlen(pCreateInfo->ppEnabledExtensionNames[i] + 1));
+ if (ptr_instance->extension_names[i] == NULL)
+ return VK_ERROR_OUT_OF_MEMORY;
+ strcpy(ptr_instance->extension_names[i], pCreateInfo->ppEnabledExtensionNames[i]);
+ }
ptr_instance->next = loader.instances;
loader.instances = ptr_instance;
struct loader_instance *ptr_instance = (struct loader_instance *) instance;
struct loader_scanned_icds *scanned_icds;
VkResult res;
+ uint32_t i;
// Remove this instance from the list of instances:
struct loader_instance *prev = NULL;
while (next != NULL) {
if (next == ptr_instance) {
// Remove this instance from the list:
+ for (i = 0; i < ptr_instance->extension_count; i++) {
+ free(ptr_instance->extension_names[i]);
+ }
if (prev)
prev->next = next->next;
else