loader: Return error if layer loading failed
authorCharles Giessen <charles@lunarg.com>
Mon, 1 Jun 2020 22:26:54 +0000 (16:26 -0600)
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>
Wed, 2 Sep 2020 23:40:27 +0000 (17:40 -0600)
Loader will now fail vkCreateInstance with VK_ERROR_LAYER_NOT_PRESENT
if the layer's library failed to load. Previously, it would log the
error but continue, leading to false positives since it would return
VK_SUCCESS.

Change-Id: I00804b6f02cc6e927ac0219b4cb0c2361d6561fe

loader/loader.c

index 5b639feef2f8a89550941433d29f2f0aefb4a544..b7660b92b550613f25b4f47973e79c245574d7f0 100644 (file)
@@ -5942,7 +5942,7 @@ VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo, c
 
             lib_handle = loaderOpenLayerFile(inst, "instance", layer_prop);
             if (!lib_handle) {
-                continue;
+                return VK_ERROR_LAYER_NOT_PRESENT;
             }
 
             if (NULL == layer_prop->functions.negotiate_layer_interface) {