From 6cc7160393fb8f158a2bd43aeaffe1274ed3c693 Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Sun, 7 Feb 2016 15:17:26 -0700 Subject: layers: In GetInstanceProcAddr, intercept instance procs even if NULL instance This problem showed up when running cube --validate and the order of the layers was arranged so that the threading layer is NOT first. It can also show up when running vktrace and the threading layer is in any position, because the vktrace layer becomes first. The symptom is generally a failure to create an instance when the threading layer is enabled. The fix is to check for the non-instance-based procs first by calling layer_intercept_instance_proc before bailing if the instance is NULL. --- layers/threading.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'layers/threading.cpp') diff --git a/layers/threading.cpp b/layers/threading.cpp index fd7a4159..fcdd38b1 100644 --- a/layers/threading.cpp +++ b/layers/threading.cpp @@ -286,15 +286,15 @@ VK_LAYER_EXPORT PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance i PFN_vkVoidFunction addr; layer_data* my_data; - if (instance == VK_NULL_HANDLE) { - return NULL; - } - addr = layer_intercept_instance_proc(funcName); if (addr) { return addr; } + if (instance == VK_NULL_HANDLE) { + return NULL; + } + my_data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); addr = debug_report_get_instance_proc_addr(my_data->report_data, funcName); if (addr) { -- cgit v1.2.3