loader: Fix bug on pass by value for created_instance
authorJon Ashburn <jon@lunarg.com>
Wed, 3 Feb 2016 19:37:30 +0000 (12:37 -0700)
committerJon Ashburn <jon@lunarg.com>
Wed, 3 Feb 2016 19:37:30 +0000 (12:37 -0700)
loader/loader.c
loader/loader.h
loader/trampoline.c

index c7c6472..5ce7f9d 100644 (file)
@@ -2865,7 +2865,7 @@ loader_enable_instance_layers(struct loader_instance *inst,
 VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo,
                                       const VkAllocationCallbacks *pAllocator,
                                       struct loader_instance *inst,
-                                      VkInstance created_instance) {
+                                      VkInstance *created_instance) {
     uint32_t activated_layers = 0;
     VkLayerInstanceCreateInfo chain_info;
     VkLayerInstanceLink *layer_instance_link_info = NULL;
@@ -2940,7 +2940,7 @@ VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo,
     }
 
     PFN_vkCreateInstance fpCreateInstance =
-        (PFN_vkCreateInstance)nextGIPA(created_instance, "vkCreateInstance");
+        (PFN_vkCreateInstance)nextGIPA(*created_instance, "vkCreateInstance");
     if (fpCreateInstance) {
         VkLayerInstanceCreateInfo instance_create_info;
 
@@ -2956,7 +2956,7 @@ VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo,
         loader_create_info.pNext = &instance_create_info;
 
         res = fpCreateInstance(&loader_create_info, pAllocator,
-                               &created_instance);
+                               created_instance);
     } else {
         // Couldn't find CreateInstance function!
         res = VK_ERROR_INITIALIZATION_FAILED;
@@ -2966,7 +2966,7 @@ VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo,
         // TODO: Need to clean up here
     } else {
         loader_init_instance_core_dispatch_table(inst->disp, nextGIPA,
-                                                 created_instance);
+                                                 *created_instance);
     }
 
     return res;
index 266ec03..ac20d74 100644 (file)
@@ -494,7 +494,7 @@ void loader_deactivate_instance_layers(struct loader_instance *instance);
 VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo,
                                       const VkAllocationCallbacks *pAllocator,
                                       struct loader_instance *inst,
-                                      VkInstance created_instance);
+                                      VkInstance *created_instance);
 
 void loader_activate_instance_layer_extensions(struct loader_instance *inst,
                                                VkInstance created_inst);
index 48d1b72..2a8f25d 100644 (file)
@@ -190,7 +190,7 @@ vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo,
 
     created_instance = (VkInstance)ptr_instance;
     res = loader_create_instance_chain(pCreateInfo, pAllocator, ptr_instance,
-                                       created_instance);
+                                       &created_instance);
 
     if (res == VK_SUCCESS) {
         wsi_create_instance(ptr_instance, pCreateInfo);