aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Ashburn <jon@lunarg.com>2016-01-18 12:20:03 -0700
committerJon Ashburn <jon@lunarg.com>2016-01-18 12:20:03 -0700
commit3ca0c82c23d95f2173d5fa93029c74597a04976d (patch)
tree43136258ccfb90aa58e9312b398611f8b932ff68
parentb1a92dd6fb3a198763f243b86884b16acb752d5e (diff)
downloadusermoji-3ca0c82c23d95f2173d5fa93029c74597a04976d.tar.xz
loader: Return the loader created instance rather than from the instance chain
Fix's issue with layers that wrap instance.
-rw-r--r--loader/trampoline.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/loader/trampoline.c b/loader/trampoline.c
index f46d40f7..563fec60 100644
--- a/loader/trampoline.c
+++ b/loader/trampoline.c
@@ -43,6 +43,7 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(
VkInstance* pInstance)
{
struct loader_instance *ptr_instance = NULL;
+ VkInstance created_instance = VK_NULL_HANDLE;
VkResult res = VK_ERROR_INITIALIZATION_FAILED;
VkDebugReportCallbackEXT instance_callback = VK_NULL_HANDLE;
void *pNext = (void *) pCreateInfo->pNext;
@@ -180,11 +181,11 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(
wsi_create_instance(ptr_instance, pCreateInfo);
debug_report_create_instance(ptr_instance, pCreateInfo);
-
- res = ptr_instance->disp->CreateInstance(pCreateInfo, pAllocator, &ptr_instance);
+ created_instance = (VkInstance) ptr_instance;
+ res = ptr_instance->disp->CreateInstance(pCreateInfo, pAllocator, &created_instance);
if (res == VK_SUCCESS) {
- *pInstance = (VkInstance) ptr_instance;
+ *pInstance = created_instance;
/*
* Finally have the layers in place and everyone has seen
* the CreateInstance command go by. This allows the layer's