From fcb667c012545e70c71c5ebafeff234038fa14c3 Mon Sep 17 00:00:00 2001 From: Jon Ashburn Date: Wed, 3 Feb 2016 12:37:30 -0700 Subject: [PATCH] loader: Fix bug on pass by value for created_instance --- loader/loader.c | 8 ++++---- loader/loader.h | 2 +- loader/trampoline.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/loader/loader.c b/loader/loader.c index c7c6472..5ce7f9d 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -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; diff --git a/loader/loader.h b/loader/loader.h index 266ec03..ac20d74 100644 --- a/loader/loader.h +++ b/loader/loader.h @@ -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); diff --git a/loader/trampoline.c b/loader/trampoline.c index 48d1b72..2a8f25d 100644 --- a/loader/trampoline.c +++ b/loader/trampoline.c @@ -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); -- 2.7.4