Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/Vulkan-Loader.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>2022-10-13 00:45:58 +0300
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>2022-10-13 01:22:24 +0300
commita53232449eb27a74d4704ae40243447e415e6185 (patch)
tree740c9dc7b2e66eb2efb6d9cc3065b002af4b6317
parent23a050bc7693e2bdc87f43039fa85c738a626926 (diff)
Revert "Don't load layer libraries in vkCreateDevice"
This reverts commit cd9b4afed4e556ac88a75371eb7283fed94ca3c6.
-rw-r--r--loader/loader.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/loader/loader.c b/loader/loader.c
index ae819cef5..ed33af356 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -1191,8 +1191,12 @@ void loader_destroy_logical_device(const struct loader_instance *inst, struct lo
if (pAllocator) {
dev->alloc_callbacks = *pAllocator;
}
- loader_destroy_layer_list(inst, dev, &dev->expanded_activated_layer_list);
- loader_destroy_layer_list(inst, dev, &dev->app_activated_layer_list);
+ if (NULL != dev->expanded_activated_layer_list.list) {
+ loader_deactivate_layers(inst, dev, &dev->expanded_activated_layer_list);
+ }
+ if (NULL != dev->app_activated_layer_list.list) {
+ loader_destroy_layer_list(inst, dev, &dev->app_activated_layer_list);
+ }
loader_device_heap_free(dev, dev);
}
@@ -3981,7 +3985,8 @@ struct loader_instance *loader_get_instance(const VkInstance instance) {
return ptr_instance;
}
-static loader_platform_dl_handle loader_open_layer_file(const struct loader_instance *inst, struct loader_layer_properties *prop) {
+static loader_platform_dl_handle loader_open_layer_file(const struct loader_instance *inst, const char *chain_type,
+ struct loader_layer_properties *prop) {
if ((prop->lib_handle = loader_platform_open_library(prop->lib_name)) == NULL) {
loader_handle_load_library_error(inst, prop->lib_name, &prop->lib_status);
} else {
@@ -4374,7 +4379,7 @@ VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo, c
continue;
}
- lib_handle = loader_open_layer_file(inst, layer_prop);
+ lib_handle = loader_open_layer_file(inst, "instance", layer_prop);
if (!lib_handle) {
continue;
}
@@ -4688,15 +4693,23 @@ VkResult loader_create_device_chain(const VkPhysicalDevice pd, const VkDeviceCre
chain_info.pNext = loader_create_info.pNext;
loader_create_info.pNext = &chain_info;
+ bool done = false;
+
// Create instance chain of enabled layers
for (int32_t i = dev->expanded_activated_layer_list.count - 1; i >= 0; i--) {
struct loader_layer_properties *layer_prop = &dev->expanded_activated_layer_list.list[i];
- loader_platform_dl_handle lib_handle = layer_prop->lib_handle;
+ loader_platform_dl_handle lib_handle;
+
// Skip it if a Layer with the same name has been already successfully activated
if (loader_names_array_has_layer_property(&layer_prop->info, num_activated_layers, activated_layers)) {
continue;
}
+ lib_handle = loader_open_layer_file(inst, "device", layer_prop);
+ if (!lib_handle || done) {
+ continue;
+ }
+
// The Get*ProcAddr pointers will already be filled in if they were received from either the json file or the
// version negotiation
if ((fpGIPA = layer_prop->functions.get_instance_proc_addr) == NULL) {
@@ -4718,6 +4731,7 @@ VkResult loader_create_device_chain(const VkPhysicalDevice pd, const VkDeviceCre
if (layerNextGDPA != NULL) {
*layerNextGDPA = nextGDPA;
}
+ done = true;
continue;
}