aboutsummaryrefslogtreecommitdiff
path: root/layers/threading.cpp
diff options
context:
space:
mode:
authorKarl Schultz <karl@lunarg.com>2016-02-07 15:17:26 -0700
committerKarl Schultz <karl@lunarg.com>2016-02-07 15:17:26 -0700
commit6cc7160393fb8f158a2bd43aeaffe1274ed3c693 (patch)
tree3b9141255ef2a155d9a297ceb2e2f2d2718d3f95 /layers/threading.cpp
parent154de2f68bc149f2b3e46203459be69e888a5d12 (diff)
downloadusermoji-6cc7160393fb8f158a2bd43aeaffe1274ed3c693.tar.xz
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.
Diffstat (limited to 'layers/threading.cpp')
-rw-r--r--layers/threading.cpp8
1 files changed, 4 insertions, 4 deletions
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) {