diff options
| author | Jon Ashburn <jon@lunarg.com> | 2015-10-01 12:03:17 -0600 |
|---|---|---|
| committer | Jon Ashburn <jon@lunarg.com> | 2015-10-01 13:32:55 -0600 |
| commit | 8ec45b01e3a30111b247d896290bd13f4a3b50c2 (patch) | |
| tree | 2cbb43619e7abb891e5180ad1275ce903d111757 /loader/debug_report.c | |
| parent | a1eff8b7a2c3f045b25fc80ad957e6fd0d973c53 (diff) | |
| download | usermoji-8ec45b01e3a30111b247d896290bd13f4a3b50c2.tar.xz | |
loader: Fix vkGetInstanceProcAddr to handle debug_report extension
Need loader entrypoints for debug_report extension including the utility
functions. Don't call down the instance chain GPA for this extension.
Remove instance extensions decoding when GPA instance == NULL as don't want
to return extension entrypoints unless they are enabled.
This meant the WSI swapchain instance GPA was no longer used so remove it.
Diffstat (limited to 'loader/debug_report.c')
| -rw-r--r-- | loader/debug_report.c | 45 |
1 files changed, 28 insertions, 17 deletions
diff --git a/loader/debug_report.c b/loader/debug_report.c index 63c86c6f..c8686dc0 100644 --- a/loader/debug_report.c +++ b/loader/debug_report.c @@ -320,23 +320,34 @@ static void VKAPI BreakCallback( #endif } -void *debug_report_instance_gpa( +bool debug_report_instance_gpa( struct loader_instance *ptr_instance, - const char* name) + const char* name, + void **addr) { - if (ptr_instance == VK_NULL_HANDLE || !ptr_instance->debug_report_enabled) - return NULL; - - if (!strcmp("vkDbgCreateMsgCallback", name)) - return (void *) debug_report_DbgCreateMsgCallback; - else if (!strcmp("vkDbgDestroyMsgCallback", name)) - return (void *) debug_report_DbgDestroyMsgCallback; - else if (!strcmp("vkDbgStringCallback", name)) - return (void *) StringCallback; - else if (!strcmp("vkDbgStdioCallback", name)) - return (void *) StdioCallback; - else if (!strcmp("vkDbgBreakCallback", name)) - return (void *) BreakCallback; - - return NULL; + *addr = NULL; + if (ptr_instance == VK_NULL_HANDLE) + return false; + + if (!strcmp("vkDbgCreateMsgCallback", name)) { + *addr = ptr_instance->debug_report_enabled ? (void *) debug_report_DbgCreateMsgCallback : NULL; + return true; + } + if (!strcmp("vkDbgDestroyMsgCallback", name)) { + *addr = ptr_instance->debug_report_enabled ? (void *) debug_report_DbgDestroyMsgCallback : NULL; + return true; + } + if (!strcmp("vkDbgStringCallback", name)) { + *addr = ptr_instance->debug_report_enabled ? (void *) StringCallback : NULL; + return true; + } + if (!strcmp("vkDbgStdioCallback", name)) { + *addr = ptr_instance->debug_report_enabled ? (void *) StdioCallback : NULL; + return true; + } + if (!strcmp("vkDbgBreakCallback", name)) { + *addr = ptr_instance->debug_report_enabled ? (void *) BreakCallback : NULL; + return true; + } + return false; } |
