Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions loader/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -4874,6 +4874,8 @@ VKAPI_ATTR VkResult VKAPI_CALL loader_layer_create_device(VkInstance instance, V
struct loader_device *dev = NULL;
struct loader_instance *inst = NULL;

loader_platform_thread_lock_mutex(&loader_lock);

if (instance != VK_NULL_HANDLE) {
inst = loader_get_instance(instance);
internal_device = physicalDevice;
Expand Down Expand Up @@ -4974,6 +4976,8 @@ VKAPI_ATTR VkResult VKAPI_CALL loader_layer_create_device(VkInstance instance, V
if (NULL != icd_exts.list) {
loader_destroy_generic_list(inst, (struct loader_generic_list *)&icd_exts);
}

loader_platform_thread_unlock_mutex(&loader_lock);
return res;
}

Expand All @@ -4985,6 +4989,8 @@ VKAPI_ATTR void VKAPI_CALL loader_layer_destroy_device(VkDevice device, const Vk
return;
}

loader_platform_thread_lock_mutex(&loader_lock);

struct loader_icd_term *icd_term = loader_get_icd_and_device(device, &dev);

destroyFunction(device, pAllocator);
Expand All @@ -4993,6 +4999,8 @@ VKAPI_ATTR void VKAPI_CALL loader_layer_destroy_device(VkDevice device, const Vk
dev->icd_device = NULL;
loader_remove_logical_device(icd_term, dev, pAllocator);
}

loader_platform_thread_unlock_mutex(&loader_lock);
}

// Given the list of layers to activate in the loader_instance
Expand Down