diff options
Diffstat (limited to 'loader/trampoline.c')
| -rw-r--r-- | loader/trampoline.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/loader/trampoline.c b/loader/trampoline.c index 63574830..58a3d2fb 100644 --- a/loader/trampoline.c +++ b/loader/trampoline.c @@ -44,6 +44,8 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance( { struct loader_instance *ptr_instance = NULL; VkResult res = VK_ERROR_INITIALIZATION_FAILED; + VkDebugReportCallbackLUNARG instance_callback = VK_NULL_HANDLE; + void *pNext = (void *) pCreateInfo->pNext; loader_platform_thread_once(&once_init, loader_initialize); @@ -68,6 +70,17 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance( ptr_instance->alloc_callbacks = *pAllocator; } + while (!pNext) { + if (((VkInstanceCreateInfo *)pNext)->sType == VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_LUNARG) { + instance_callback = (VkDebugReportCallbackLUNARG) ptr_instance; + if (util_CreateDebugReportCallback(ptr_instance, pNext, pAllocator, instance_callback)) { + free(ptr_instance); + loader_platform_thread_unlock_mutex(&loader_lock); + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + } + } + /* Due to implicit layers need to get layer list even if * enabledLayerNameCount == 0 and VK_INSTANCE_LAYERS is unset. For now always * get layer list (both instance and device) via loader_layer_scan(). */ |
