Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 1 | /* |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 2 | * Copyright (c) 2015-2016 The Khronos Group Inc. |
| 3 | * Copyright (c) 2015-2016 Valve Corporation |
| 4 | * Copyright (c) 2015-2016 LunarG, Inc. |
| 5 | * Copyright (C) 2015-2016 Google Inc. |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 6 | * |
Jon Ashburn | 3ebf125 | 2016-04-19 11:30:31 -0600 | [diff] [blame] | 7 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | * you may not use this file except in compliance with the License. |
| 9 | * You may obtain a copy of the License at |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 10 | * |
Jon Ashburn | 3ebf125 | 2016-04-19 11:30:31 -0600 | [diff] [blame] | 11 | * http://www.apache.org/licenses/LICENSE-2.0 |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 12 | * |
Jon Ashburn | 3ebf125 | 2016-04-19 11:30:31 -0600 | [diff] [blame] | 13 | * Unless required by applicable law or agreed to in writing, software |
| 14 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | * See the License for the specific language governing permissions and |
| 17 | * limitations under the License. |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 18 | * |
Courtney Goeltzenleuchter | 0555952 | 2015-10-30 11:14:30 -0600 | [diff] [blame] | 19 | * Author: Courtney Goeltzenleuchter <courtney@LunarG.com> |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 20 | * Author: Jon Ashburn <jon@LunarG.com> |
Courtney Goeltzenleuchter | 0555952 | 2015-10-30 11:14:30 -0600 | [diff] [blame] | 21 | * |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 22 | */ |
| 23 | |
Courtney Goeltzenleuchter | 7f5aafc | 2015-07-05 11:28:29 -0600 | [diff] [blame] | 24 | #define _GNU_SOURCE |
Courtney Goeltzenleuchter | 7dcc6a7 | 2015-06-11 16:01:11 -0600 | [diff] [blame] | 25 | #include <stdio.h> |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 26 | #include <string.h> |
| 27 | #include <stdlib.h> |
Courtney Goeltzenleuchter | 7dcc6a7 | 2015-06-11 16:01:11 -0600 | [diff] [blame] | 28 | #include <inttypes.h> |
Tony Barbour | 1d825c7 | 2015-06-18 16:29:32 -0600 | [diff] [blame] | 29 | #ifndef WIN32 |
Courtney Goeltzenleuchter | 03663d0 | 2015-07-22 11:01:53 -0600 | [diff] [blame] | 30 | #include <signal.h> |
| 31 | #else |
Tony Barbour | 1d825c7 | 2015-06-18 16:29:32 -0600 | [diff] [blame] | 32 | #endif |
Jon Ashburn | 480a50a | 2015-08-28 14:58:46 -0700 | [diff] [blame] | 33 | #include "vk_loader_platform.h" |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 34 | #include "debug_report.h" |
David Pinedo | 9316d3b | 2015-11-06 12:54:48 -0700 | [diff] [blame] | 35 | #include "vulkan/vk_layer.h" |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 36 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 37 | typedef void(VKAPI_PTR *PFN_stringCallback)(char *message); |
Courtney Goeltzenleuchter | 7dcc6a7 | 2015-06-11 16:01:11 -0600 | [diff] [blame] | 38 | |
Jon Ashburn | 5c042ea | 2015-08-04 11:14:18 -0600 | [diff] [blame] | 39 | static const VkExtensionProperties debug_report_extension_info = { |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 40 | .extensionName = VK_EXT_DEBUG_REPORT_EXTENSION_NAME, |
| 41 | .specVersion = VK_EXT_DEBUG_REPORT_SPEC_VERSION, |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 42 | }; |
| 43 | |
| 44 | void debug_report_add_instance_extensions( |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 45 | const struct loader_instance *inst, |
| 46 | struct loader_extension_list *ext_list) { |
Jon Ashburn | e39a4f8 | 2015-08-28 13:38:21 -0600 | [diff] [blame] | 47 | loader_add_to_ext_list(inst, ext_list, 1, &debug_report_extension_info); |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 48 | } |
| 49 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 50 | void debug_report_create_instance(struct loader_instance *ptr_instance, |
| 51 | const VkInstanceCreateInfo *pCreateInfo) { |
Mark Young | 35159af | 2016-09-07 08:50:32 -0600 | [diff] [blame] | 52 | ptr_instance->enabled_known_extensions.ext_debug_report = 0; |
Courtney Goeltzenleuchter | 110fdf9 | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 53 | |
Jon Ashburn | f19916e | 2016-01-11 13:12:43 -0700 | [diff] [blame] | 54 | for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) { |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 55 | if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], |
| 56 | VK_EXT_DEBUG_REPORT_EXTENSION_NAME) == 0) { |
Mark Young | 35159af | 2016-09-07 08:50:32 -0600 | [diff] [blame] | 57 | ptr_instance->enabled_known_extensions.ext_debug_report = 1; |
Courtney Goeltzenleuchter | 110fdf9 | 2015-06-29 15:39:26 -0600 | [diff] [blame] | 58 | return; |
| 59 | } |
| 60 | } |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 61 | } |
| 62 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 63 | VkResult |
| 64 | util_CreateDebugReportCallback(struct loader_instance *inst, |
| 65 | VkDebugReportCallbackCreateInfoEXT *pCreateInfo, |
| 66 | const VkAllocationCallbacks *pAllocator, |
| 67 | VkDebugReportCallbackEXT callback) { |
Mark Young | 7e4da97 | 2016-08-25 14:54:58 -0600 | [diff] [blame] | 68 | VkLayerDbgFunctionNode *pNewDbgFuncNode = NULL; |
| 69 | |
Mark Young | 0ad8313 | 2016-06-30 13:02:42 -0600 | [diff] [blame] | 70 | #if (DEBUG_DISABLE_APP_ALLOCATORS == 1) |
| 71 | { |
| 72 | #else |
Courtney Goeltzenleuchter | 8288727 | 2015-12-02 15:29:33 -0700 | [diff] [blame] | 73 | if (pAllocator != NULL) { |
Mark Young | 7e4da97 | 2016-08-25 14:54:58 -0600 | [diff] [blame] | 74 | pNewDbgFuncNode = |
| 75 | (VkLayerDbgFunctionNode *)pAllocator->pfnAllocation( |
| 76 | pAllocator->pUserData, sizeof(VkLayerDbgFunctionNode), |
| 77 | sizeof(int *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); |
Courtney Goeltzenleuchter | 8288727 | 2015-12-02 15:29:33 -0700 | [diff] [blame] | 78 | } else { |
Mark Young | 0ad8313 | 2016-06-30 13:02:42 -0600 | [diff] [blame] | 79 | #endif |
Mark Young | 7e4da97 | 2016-08-25 14:54:58 -0600 | [diff] [blame] | 80 | pNewDbgFuncNode = |
| 81 | (VkLayerDbgFunctionNode *)loader_instance_heap_alloc( |
| 82 | inst, sizeof(VkLayerDbgFunctionNode), |
| 83 | VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); |
Courtney Goeltzenleuchter | 8288727 | 2015-12-02 15:29:33 -0700 | [diff] [blame] | 84 | } |
Mark Young | 7e4da97 | 2016-08-25 14:54:58 -0600 | [diff] [blame] | 85 | if (!pNewDbgFuncNode) { |
Courtney Goeltzenleuchter | 8288727 | 2015-12-02 15:29:33 -0700 | [diff] [blame] | 86 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
Mark Young | 7e4da97 | 2016-08-25 14:54:58 -0600 | [diff] [blame] | 87 | } |
| 88 | memset(pNewDbgFuncNode, 0, sizeof(VkLayerDbgFunctionNode)); |
Courtney Goeltzenleuchter | 8288727 | 2015-12-02 15:29:33 -0700 | [diff] [blame] | 89 | |
| 90 | pNewDbgFuncNode->msgCallback = callback; |
| 91 | pNewDbgFuncNode->pfnMsgCallback = pCreateInfo->pfnCallback; |
| 92 | pNewDbgFuncNode->msgFlags = pCreateInfo->flags; |
| 93 | pNewDbgFuncNode->pUserData = pCreateInfo->pUserData; |
| 94 | pNewDbgFuncNode->pNext = inst->DbgFunctionHead; |
| 95 | inst->DbgFunctionHead = pNewDbgFuncNode; |
| 96 | |
| 97 | return VK_SUCCESS; |
| 98 | } |
| 99 | |
Mark Young | 35159af | 2016-09-07 08:50:32 -0600 | [diff] [blame] | 100 | static VKAPI_ATTR VkResult VKAPI_CALL debug_report_CreateDebugReportCallbackEXT( |
| 101 | VkInstance instance, const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, |
| 102 | const VkAllocationCallbacks *pAllocator, |
| 103 | VkDebugReportCallbackEXT *pCallback) { |
Jon Ashburn | e0e6457 | 2015-09-30 12:56:42 -0600 | [diff] [blame] | 104 | struct loader_instance *inst = loader_get_instance(instance); |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 105 | loader_platform_thread_lock_mutex(&loader_lock); |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 106 | VkResult result = inst->disp->CreateDebugReportCallbackEXT( |
| 107 | instance, pCreateInfo, pAllocator, pCallback); |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 108 | loader_platform_thread_unlock_mutex(&loader_lock); |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 109 | return result; |
| 110 | } |
| 111 | |
Courtney Goeltzenleuchter | 822e8d7 | 2015-11-30 15:28:25 -0700 | [diff] [blame] | 112 | // Utility function to handle reporting |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 113 | VkBool32 util_DebugReportMessage(const struct loader_instance *inst, |
| 114 | VkFlags msgFlags, |
| 115 | VkDebugReportObjectTypeEXT objectType, |
| 116 | uint64_t srcObject, size_t location, |
| 117 | int32_t msgCode, const char *pLayerPrefix, |
| 118 | const char *pMsg) { |
Courtney Goeltzenleuchter | 822e8d7 | 2015-11-30 15:28:25 -0700 | [diff] [blame] | 119 | VkBool32 bail = false; |
| 120 | VkLayerDbgFunctionNode *pTrav = inst->DbgFunctionHead; |
| 121 | while (pTrav) { |
| 122 | if (pTrav->msgFlags & msgFlags) { |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 123 | if (pTrav->pfnMsgCallback(msgFlags, objectType, srcObject, location, |
| 124 | msgCode, pLayerPrefix, pMsg, |
| 125 | pTrav->pUserData)) { |
Courtney Goeltzenleuchter | 822e8d7 | 2015-11-30 15:28:25 -0700 | [diff] [blame] | 126 | bail = true; |
| 127 | } |
| 128 | } |
| 129 | pTrav = pTrav->pNext; |
| 130 | } |
| 131 | |
| 132 | return bail; |
| 133 | } |
| 134 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 135 | void util_DestroyDebugReportCallback(struct loader_instance *inst, |
| 136 | VkDebugReportCallbackEXT callback, |
| 137 | const VkAllocationCallbacks *pAllocator) { |
Courtney Goeltzenleuchter | 8288727 | 2015-12-02 15:29:33 -0700 | [diff] [blame] | 138 | VkLayerDbgFunctionNode *pTrav = inst->DbgFunctionHead; |
| 139 | VkLayerDbgFunctionNode *pPrev = pTrav; |
| 140 | |
| 141 | while (pTrav) { |
| 142 | if (pTrav->msgCallback == callback) { |
| 143 | pPrev->pNext = pTrav->pNext; |
| 144 | if (inst->DbgFunctionHead == pTrav) |
| 145 | inst->DbgFunctionHead = pTrav->pNext; |
Mark Young | 0ad8313 | 2016-06-30 13:02:42 -0600 | [diff] [blame] | 146 | #if (DEBUG_DISABLE_APP_ALLOCATORS == 1) |
| 147 | { |
| 148 | #else |
Courtney Goeltzenleuchter | 8288727 | 2015-12-02 15:29:33 -0700 | [diff] [blame] | 149 | if (pAllocator != NULL) { |
| 150 | pAllocator->pfnFree(pAllocator->pUserData, pTrav); |
| 151 | } else { |
Mark Young | 0ad8313 | 2016-06-30 13:02:42 -0600 | [diff] [blame] | 152 | #endif |
| 153 | loader_instance_heap_free(inst, pTrav); |
Courtney Goeltzenleuchter | 8288727 | 2015-12-02 15:29:33 -0700 | [diff] [blame] | 154 | } |
| 155 | break; |
| 156 | } |
| 157 | pPrev = pTrav; |
| 158 | pTrav = pTrav->pNext; |
| 159 | } |
| 160 | } |
Courtney Goeltzenleuchter | 822e8d7 | 2015-11-30 15:28:25 -0700 | [diff] [blame] | 161 | |
Ian Elliott | ad6300f | 2016-03-31 10:48:19 -0600 | [diff] [blame] | 162 | // This utility (used by vkInstanceCreateInfo(), looks at a pNext chain. It |
| 163 | // counts any VkDebugReportCallbackCreateInfoEXT structs that it finds. It |
| 164 | // then allocates array that can hold that many structs, as well as that many |
| 165 | // VkDebugReportCallbackEXT handles. It then copies each |
| 166 | // VkDebugReportCallbackCreateInfoEXT, and initializes each handle. |
Jon Ashburn | cc407a2 | 2016-04-15 09:25:03 -0600 | [diff] [blame] | 167 | VkResult util_CopyDebugReportCreateInfos( |
| 168 | const void *pChain, const VkAllocationCallbacks *pAllocator, |
| 169 | uint32_t *num_callbacks, VkDebugReportCallbackCreateInfoEXT **infos, |
| 170 | VkDebugReportCallbackEXT **callbacks) { |
Ian Elliott | ad6300f | 2016-03-31 10:48:19 -0600 | [diff] [blame] | 171 | uint32_t n = *num_callbacks = 0; |
Mark Young | 0ad8313 | 2016-06-30 13:02:42 -0600 | [diff] [blame] | 172 | VkDebugReportCallbackCreateInfoEXT *pInfos = NULL; |
| 173 | VkDebugReportCallbackEXT *pCallbacks = NULL; |
Ian Elliott | ad6300f | 2016-03-31 10:48:19 -0600 | [diff] [blame] | 174 | |
| 175 | // NOTE: The loader is not using pAllocator, and so this function doesn't |
| 176 | // either. |
| 177 | |
| 178 | const void *pNext = pChain; |
| 179 | while (pNext) { |
| 180 | // 1st, count the number VkDebugReportCallbackCreateInfoEXT: |
| 181 | if (((VkDebugReportCallbackCreateInfoEXT *)pNext)->sType == |
| 182 | VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT) { |
| 183 | n++; |
| 184 | } |
| 185 | pNext = (void *)((VkDebugReportCallbackCreateInfoEXT *)pNext)->pNext; |
| 186 | } |
| 187 | if (n == 0) { |
| 188 | return VK_SUCCESS; |
| 189 | } |
| 190 | |
Mark Young | 0ad8313 | 2016-06-30 13:02:42 -0600 | [diff] [blame] | 191 | // 2nd, allocate memory for each VkDebugReportCallbackCreateInfoEXT: |
| 192 | #if (DEBUG_DISABLE_APP_ALLOCATORS == 1) |
| 193 | { |
| 194 | #else |
| 195 | if (pAllocator != NULL) { |
| 196 | pInfos = *infos = |
| 197 | ((VkDebugReportCallbackCreateInfoEXT *)pAllocator->pfnAllocation( |
| 198 | pAllocator->pUserData, |
| 199 | n * sizeof(VkDebugReportCallbackCreateInfoEXT), sizeof(void *), |
| 200 | VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); |
| 201 | } else { |
| 202 | #endif |
| 203 | pInfos = *infos = ((VkDebugReportCallbackCreateInfoEXT *)malloc( |
Jon Ashburn | cc407a2 | 2016-04-15 09:25:03 -0600 | [diff] [blame] | 204 | n * sizeof(VkDebugReportCallbackCreateInfoEXT))); |
Mark Young | 0ad8313 | 2016-06-30 13:02:42 -0600 | [diff] [blame] | 205 | } |
Ian Elliott | ad6300f | 2016-03-31 10:48:19 -0600 | [diff] [blame] | 206 | if (!pInfos) { |
| 207 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 208 | } |
Mark Young | 0ad8313 | 2016-06-30 13:02:42 -0600 | [diff] [blame] | 209 | // 3rd, allocate memory for a unique handle for each callback: |
| 210 | #if (DEBUG_DISABLE_APP_ALLOCATORS == 1) |
| 211 | { |
| 212 | #else |
| 213 | if (pAllocator != NULL) { |
| 214 | pCallbacks = *callbacks = |
| 215 | ((VkDebugReportCallbackEXT *)pAllocator->pfnAllocation( |
| 216 | pAllocator->pUserData, n * sizeof(VkDebugReportCallbackEXT), |
| 217 | sizeof(void *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); |
Mark Young | 0fea692 | 2016-11-21 16:20:06 -0700 | [diff] [blame] | 218 | if (!pCallbacks) { |
| 219 | pAllocator->pfnFree(pAllocator->pUserData, pInfos); |
| 220 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 221 | } |
Mark Young | 0ad8313 | 2016-06-30 13:02:42 -0600 | [diff] [blame] | 222 | } else { |
| 223 | #endif |
| 224 | pCallbacks = *callbacks = ((VkDebugReportCallbackEXT *)malloc( |
| 225 | n * sizeof(VkDebugReportCallbackEXT))); |
Mark Young | 0fea692 | 2016-11-21 16:20:06 -0700 | [diff] [blame] | 226 | if (!pCallbacks) { |
| 227 | free(pInfos); |
| 228 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 229 | } |
Ian Elliott | ad6300f | 2016-03-31 10:48:19 -0600 | [diff] [blame] | 230 | } |
| 231 | // 4th, copy each VkDebugReportCallbackCreateInfoEXT for use by |
| 232 | // vkDestroyInstance, and assign a unique handle to each callback (just |
| 233 | // use the address of the copied VkDebugReportCallbackCreateInfoEXT): |
| 234 | pNext = pChain; |
| 235 | while (pNext) { |
| 236 | if (((VkInstanceCreateInfo *)pNext)->sType == |
| 237 | VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT) { |
Jon Ashburn | cc407a2 | 2016-04-15 09:25:03 -0600 | [diff] [blame] | 238 | memcpy(pInfos, pNext, sizeof(VkDebugReportCallbackCreateInfoEXT)); |
Karl Schultz | 9497129 | 2016-11-19 09:02:27 -0700 | [diff] [blame] | 239 | *pCallbacks++ = (VkDebugReportCallbackEXT)(uintptr_t)pInfos++; |
Ian Elliott | ad6300f | 2016-03-31 10:48:19 -0600 | [diff] [blame] | 240 | } |
| 241 | pNext = (void *)((VkInstanceCreateInfo *)pNext)->pNext; |
| 242 | } |
| 243 | |
| 244 | *num_callbacks = n; |
| 245 | return VK_SUCCESS; |
| 246 | } |
| 247 | |
| 248 | void util_FreeDebugReportCreateInfos(const VkAllocationCallbacks *pAllocator, |
| 249 | VkDebugReportCallbackCreateInfoEXT *infos, |
Jon Ashburn | cc407a2 | 2016-04-15 09:25:03 -0600 | [diff] [blame] | 250 | VkDebugReportCallbackEXT *callbacks) { |
Mark Young | 0fea692 | 2016-11-21 16:20:06 -0700 | [diff] [blame] | 251 | #if (DEBUG_DISABLE_APP_ALLOCATORS == 1) |
| 252 | { |
| 253 | #else |
| 254 | if (pAllocator != NULL) { |
| 255 | pAllocator->pfnFree(pAllocator->pUserData, infos); |
| 256 | pAllocator->pfnFree(pAllocator->pUserData, callbacks); |
| 257 | } else { |
| 258 | #endif |
| 259 | free(infos); |
| 260 | free(callbacks); |
| 261 | } |
Ian Elliott | ad6300f | 2016-03-31 10:48:19 -0600 | [diff] [blame] | 262 | } |
| 263 | |
Jon Ashburn | cc407a2 | 2016-04-15 09:25:03 -0600 | [diff] [blame] | 264 | VkResult util_CreateDebugReportCallbacks( |
| 265 | struct loader_instance *inst, const VkAllocationCallbacks *pAllocator, |
| 266 | uint32_t num_callbacks, VkDebugReportCallbackCreateInfoEXT *infos, |
| 267 | VkDebugReportCallbackEXT *callbacks) { |
Jamie Madill | 2b6b8d5 | 2016-04-04 15:09:51 -0400 | [diff] [blame] | 268 | VkResult rtn = VK_SUCCESS; |
Jon Ashburn | cc407a2 | 2016-04-15 09:25:03 -0600 | [diff] [blame] | 269 | for (uint32_t i = 0; i < num_callbacks; i++) { |
| 270 | rtn = util_CreateDebugReportCallback(inst, &infos[i], pAllocator, |
Ian Elliott | ad6300f | 2016-03-31 10:48:19 -0600 | [diff] [blame] | 271 | callbacks[i]); |
| 272 | if (rtn != VK_SUCCESS) { |
Jon Ashburn | cc407a2 | 2016-04-15 09:25:03 -0600 | [diff] [blame] | 273 | for (uint32_t j = 0; j < i; j++) { |
| 274 | util_DestroyDebugReportCallback(inst, callbacks[j], pAllocator); |
Ian Elliott | ad6300f | 2016-03-31 10:48:19 -0600 | [diff] [blame] | 275 | } |
| 276 | return rtn; |
| 277 | } |
| 278 | } |
| 279 | return rtn; |
| 280 | } |
| 281 | |
| 282 | void util_DestroyDebugReportCallbacks(struct loader_instance *inst, |
| 283 | const VkAllocationCallbacks *pAllocator, |
| 284 | uint32_t num_callbacks, |
Jon Ashburn | cc407a2 | 2016-04-15 09:25:03 -0600 | [diff] [blame] | 285 | VkDebugReportCallbackEXT *callbacks) { |
| 286 | for (uint32_t i = 0; i < num_callbacks; i++) { |
| 287 | util_DestroyDebugReportCallback(inst, callbacks[i], pAllocator); |
Ian Elliott | ad6300f | 2016-03-31 10:48:19 -0600 | [diff] [blame] | 288 | } |
| 289 | } |
| 290 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 291 | static VKAPI_ATTR void VKAPI_CALL |
Mark Young | 35159af | 2016-09-07 08:50:32 -0600 | [diff] [blame] | 292 | debug_report_DestroyDebugReportCallbackEXT( |
| 293 | VkInstance instance, VkDebugReportCallbackEXT callback, |
| 294 | const VkAllocationCallbacks *pAllocator) { |
Jon Ashburn | e0e6457 | 2015-09-30 12:56:42 -0600 | [diff] [blame] | 295 | struct loader_instance *inst = loader_get_instance(instance); |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 296 | loader_platform_thread_lock_mutex(&loader_lock); |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 297 | |
Courtney Goeltzenleuchter | 7415d5a | 2015-12-09 15:48:16 -0700 | [diff] [blame] | 298 | inst->disp->DestroyDebugReportCallbackEXT(instance, callback, pAllocator); |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 299 | |
Courtney Goeltzenleuchter | 8288727 | 2015-12-02 15:29:33 -0700 | [diff] [blame] | 300 | util_DestroyDebugReportCallback(inst, callback, pAllocator); |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 301 | |
Jon Ashburn | 6301a0f | 2015-05-29 13:15:39 -0600 | [diff] [blame] | 302 | loader_platform_thread_unlock_mutex(&loader_lock); |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 303 | } |
| 304 | |
Mark Young | 35159af | 2016-09-07 08:50:32 -0600 | [diff] [blame] | 305 | static VKAPI_ATTR void VKAPI_CALL debug_report_DebugReportMessageEXT( |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 306 | VkInstance instance, VkDebugReportFlagsEXT flags, |
| 307 | VkDebugReportObjectTypeEXT objType, uint64_t object, size_t location, |
| 308 | int32_t msgCode, const char *pLayerPrefix, const char *pMsg) { |
Courtney Goeltzenleuchter | 822e8d7 | 2015-11-30 15:28:25 -0700 | [diff] [blame] | 309 | struct loader_instance *inst = loader_get_instance(instance); |
| 310 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 311 | inst->disp->DebugReportMessageEXT(instance, flags, objType, object, |
| 312 | location, msgCode, pLayerPrefix, pMsg); |
Courtney Goeltzenleuchter | 822e8d7 | 2015-11-30 15:28:25 -0700 | [diff] [blame] | 313 | } |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 314 | |
| 315 | /* |
| 316 | * This is the instance chain terminator function |
Courtney Goeltzenleuchter | 05854bf | 2015-11-30 12:13:14 -0700 | [diff] [blame] | 317 | * for CreateDebugReportCallback |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 318 | */ |
Tony Barbour | 1d2cd3f | 2015-07-03 10:33:54 -0600 | [diff] [blame] | 319 | |
Jon Ashburn | 1530c34 | 2016-02-26 13:14:27 -0700 | [diff] [blame] | 320 | VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDebugReportCallback( |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 321 | VkInstance instance, const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, |
| 322 | const VkAllocationCallbacks *pAllocator, |
| 323 | VkDebugReportCallbackEXT *pCallback) { |
Mark Young | 9b0636f | 2016-10-13 10:51:14 -0600 | [diff] [blame] | 324 | VkDebugReportCallbackEXT *icd_info = NULL; |
Mark Young | 0153e0b | 2016-11-03 14:27:13 -0600 | [diff] [blame] | 325 | const struct loader_icd_term *icd_term; |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 326 | struct loader_instance *inst = (struct loader_instance *)instance; |
Karl Schultz | 2558bd3 | 2016-02-24 14:39:39 -0700 | [diff] [blame] | 327 | VkResult res = VK_SUCCESS; |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 328 | uint32_t storage_idx; |
Mark Young | 7e4da97 | 2016-08-25 14:54:58 -0600 | [diff] [blame] | 329 | VkLayerDbgFunctionNode *pNewDbgFuncNode = NULL; |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 330 | |
Mark Young | 0ad8313 | 2016-06-30 13:02:42 -0600 | [diff] [blame] | 331 | #if (DEBUG_DISABLE_APP_ALLOCATORS == 1) |
| 332 | { |
| 333 | #else |
| 334 | if (pAllocator != NULL) { |
| 335 | icd_info = ((VkDebugReportCallbackEXT *)pAllocator->pfnAllocation( |
| 336 | pAllocator->pUserData, |
| 337 | inst->total_icd_count * sizeof(VkDebugReportCallbackEXT), |
| 338 | sizeof(void *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT)); |
Karl Schultz | e2ef9e6 | 2017-01-13 14:01:35 -0700 | [diff] [blame] | 339 | if (icd_info) { |
| 340 | memset(icd_info, 0, |
| 341 | inst->total_icd_count * sizeof(VkDebugReportCallbackEXT)); |
| 342 | } |
Mark Young | 0ad8313 | 2016-06-30 13:02:42 -0600 | [diff] [blame] | 343 | } else { |
| 344 | #endif |
| 345 | icd_info = |
| 346 | calloc(sizeof(VkDebugReportCallbackEXT), inst->total_icd_count); |
| 347 | } |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 348 | if (!icd_info) { |
Mark Young | 9b0636f | 2016-10-13 10:51:14 -0600 | [diff] [blame] | 349 | res = VK_ERROR_OUT_OF_HOST_MEMORY; |
| 350 | goto out; |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 351 | } |
| 352 | |
| 353 | storage_idx = 0; |
Mark Young | 0153e0b | 2016-11-03 14:27:13 -0600 | [diff] [blame] | 354 | for (icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) { |
| 355 | if (!icd_term->CreateDebugReportCallbackEXT) { |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 356 | continue; |
| 357 | } |
| 358 | |
Mark Young | 0153e0b | 2016-11-03 14:27:13 -0600 | [diff] [blame] | 359 | res = icd_term->CreateDebugReportCallbackEXT(icd_term->instance, |
| 360 | pCreateInfo, pAllocator, |
| 361 | &icd_info[storage_idx]); |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 362 | |
| 363 | if (res != VK_SUCCESS) { |
Mark Young | 9b0636f | 2016-10-13 10:51:14 -0600 | [diff] [blame] | 364 | goto out; |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 365 | } |
| 366 | storage_idx++; |
| 367 | } |
| 368 | |
Mark Young | 7e4da97 | 2016-08-25 14:54:58 -0600 | [diff] [blame] | 369 | // Setup the debug report callback in the terminator since a layer may want |
| 370 | // to grab the information itself (RenderDoc) and then return back to the |
| 371 | // user callback a sub-set of the messages. |
| 372 | #if (DEBUG_DISABLE_APP_ALLOCATORS == 0) |
| 373 | if (pAllocator != NULL) { |
| 374 | pNewDbgFuncNode = |
| 375 | (VkLayerDbgFunctionNode *)pAllocator->pfnAllocation( |
| 376 | pAllocator->pUserData, sizeof(VkLayerDbgFunctionNode), |
| 377 | sizeof(int *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); |
| 378 | } else { |
| 379 | #else |
| 380 | { |
| 381 | #endif |
| 382 | pNewDbgFuncNode = |
| 383 | (VkLayerDbgFunctionNode *)loader_instance_heap_alloc( |
| 384 | inst, sizeof(VkLayerDbgFunctionNode), |
| 385 | VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); |
| 386 | } |
| 387 | if (!pNewDbgFuncNode) { |
Mark Young | 9b0636f | 2016-10-13 10:51:14 -0600 | [diff] [blame] | 388 | res = VK_ERROR_OUT_OF_HOST_MEMORY; |
| 389 | goto out; |
Mark Young | 7e4da97 | 2016-08-25 14:54:58 -0600 | [diff] [blame] | 390 | } |
| 391 | memset(pNewDbgFuncNode, 0, sizeof(VkLayerDbgFunctionNode)); |
| 392 | |
Mark Young | 7e4da97 | 2016-08-25 14:54:58 -0600 | [diff] [blame] | 393 | pNewDbgFuncNode->pfnMsgCallback = pCreateInfo->pfnCallback; |
| 394 | pNewDbgFuncNode->msgFlags = pCreateInfo->flags; |
| 395 | pNewDbgFuncNode->pUserData = pCreateInfo->pUserData; |
| 396 | pNewDbgFuncNode->pNext = inst->DbgFunctionHead; |
| 397 | inst->DbgFunctionHead = pNewDbgFuncNode; |
| 398 | |
Mark Young | 9b0636f | 2016-10-13 10:51:14 -0600 | [diff] [blame] | 399 | *(VkDebugReportCallbackEXT **)pCallback = icd_info; |
| 400 | pNewDbgFuncNode->msgCallback = *pCallback; |
| 401 | |
| 402 | out: |
| 403 | |
| 404 | // Roll back on errors |
Mark Young | d82497d | 2016-10-14 14:18:56 -0600 | [diff] [blame] | 405 | if (VK_SUCCESS != res) { |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 406 | storage_idx = 0; |
Mark Young | 0153e0b | 2016-11-03 14:27:13 -0600 | [diff] [blame] | 407 | for (icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) { |
| 408 | if (NULL == icd_term->DestroyDebugReportCallbackEXT) { |
Mark Young | a26d47c | 2016-05-04 16:44:10 -0600 | [diff] [blame] | 409 | continue; |
| 410 | } |
| 411 | |
Karl Schultz | e2ef9e6 | 2017-01-13 14:01:35 -0700 | [diff] [blame] | 412 | if (icd_info && icd_info[storage_idx]) { |
Mark Young | 0153e0b | 2016-11-03 14:27:13 -0600 | [diff] [blame] | 413 | icd_term->DestroyDebugReportCallbackEXT( |
| 414 | icd_term->instance, icd_info[storage_idx], pAllocator); |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 415 | } |
| 416 | storage_idx++; |
| 417 | } |
| 418 | |
Mark Young | 9b0636f | 2016-10-13 10:51:14 -0600 | [diff] [blame] | 419 | #if (DEBUG_DISABLE_APP_ALLOCATORS == 1) |
| 420 | { |
| 421 | #else |
| 422 | if (pAllocator != NULL) { |
| 423 | if (NULL != pNewDbgFuncNode) { |
| 424 | pAllocator->pfnFree(pAllocator->pUserData, pNewDbgFuncNode); |
| 425 | } |
| 426 | if (NULL != icd_info) { |
| 427 | pAllocator->pfnFree(pAllocator->pUserData, icd_info); |
| 428 | } |
| 429 | } else { |
| 430 | #endif |
| 431 | if (NULL != pNewDbgFuncNode) { |
| 432 | free(pNewDbgFuncNode); |
| 433 | } |
| 434 | if (NULL != icd_info) { |
| 435 | free(icd_info); |
| 436 | } |
| 437 | } |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 438 | } |
| 439 | |
Mark Young | d82497d | 2016-10-14 14:18:56 -0600 | [diff] [blame] | 440 | return res; |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 441 | } |
| 442 | |
| 443 | /* |
| 444 | * This is the instance chain terminator function |
Courtney Goeltzenleuchter | 05854bf | 2015-11-30 12:13:14 -0700 | [diff] [blame] | 445 | * for DestroyDebugReportCallback |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 446 | */ |
Mark Young | 0ad8313 | 2016-06-30 13:02:42 -0600 | [diff] [blame] | 447 | VKAPI_ATTR void VKAPI_CALL terminator_DestroyDebugReportCallback( |
| 448 | VkInstance instance, VkDebugReportCallbackEXT callback, |
| 449 | const VkAllocationCallbacks *pAllocator) { |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 450 | uint32_t storage_idx; |
Courtney Goeltzenleuchter | 7415d5a | 2015-12-09 15:48:16 -0700 | [diff] [blame] | 451 | VkDebugReportCallbackEXT *icd_info; |
Mark Young | 0153e0b | 2016-11-03 14:27:13 -0600 | [diff] [blame] | 452 | const struct loader_icd_term *icd_term; |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 453 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 454 | struct loader_instance *inst = (struct loader_instance *)instance; |
| 455 | icd_info = *(VkDebugReportCallbackEXT **)&callback; |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 456 | storage_idx = 0; |
Mark Young | 0153e0b | 2016-11-03 14:27:13 -0600 | [diff] [blame] | 457 | for (icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) { |
| 458 | if (NULL == icd_term->DestroyDebugReportCallbackEXT) { |
Mark Young | a26d47c | 2016-05-04 16:44:10 -0600 | [diff] [blame] | 459 | continue; |
| 460 | } |
| 461 | |
Chia-I Wu | e2fc552 | 2015-10-26 20:04:44 +0800 | [diff] [blame] | 462 | if (icd_info[storage_idx]) { |
Mark Young | 0153e0b | 2016-11-03 14:27:13 -0600 | [diff] [blame] | 463 | icd_term->DestroyDebugReportCallbackEXT( |
| 464 | icd_term->instance, icd_info[storage_idx], pAllocator); |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 465 | } |
| 466 | storage_idx++; |
| 467 | } |
Mark Young | 0fea692 | 2016-11-21 16:20:06 -0700 | [diff] [blame] | 468 | |
| 469 | #if (DEBUG_DISABLE_APP_ALLOCATORS == 1) |
| 470 | { |
| 471 | #else |
| 472 | if (pAllocator != NULL) { |
| 473 | pAllocator->pfnFree(pAllocator->pUserData, icd_info); |
| 474 | } else { |
| 475 | #endif |
| 476 | free(icd_info); |
| 477 | } |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 478 | } |
| 479 | |
Courtney Goeltzenleuchter | 822e8d7 | 2015-11-30 15:28:25 -0700 | [diff] [blame] | 480 | /* |
| 481 | * This is the instance chain terminator function |
| 482 | * for DebugReportMessage |
| 483 | */ |
Mark Young | 0ad8313 | 2016-06-30 13:02:42 -0600 | [diff] [blame] | 484 | VKAPI_ATTR void VKAPI_CALL terminator_DebugReportMessage( |
| 485 | VkInstance instance, VkDebugReportFlagsEXT flags, |
| 486 | VkDebugReportObjectTypeEXT objType, uint64_t object, size_t location, |
| 487 | int32_t msgCode, const char *pLayerPrefix, const char *pMsg) { |
Mark Young | 0153e0b | 2016-11-03 14:27:13 -0600 | [diff] [blame] | 488 | const struct loader_icd_term *icd_term; |
Courtney Goeltzenleuchter | 8288727 | 2015-12-02 15:29:33 -0700 | [diff] [blame] | 489 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 490 | struct loader_instance *inst = (struct loader_instance *)instance; |
Courtney Goeltzenleuchter | 822e8d7 | 2015-11-30 15:28:25 -0700 | [diff] [blame] | 491 | |
Courtney Goeltzenleuchter | 8288727 | 2015-12-02 15:29:33 -0700 | [diff] [blame] | 492 | loader_platform_thread_lock_mutex(&loader_lock); |
Mark Young | 0153e0b | 2016-11-03 14:27:13 -0600 | [diff] [blame] | 493 | for (icd_term = inst->icd_terms; icd_term; icd_term = icd_term->next) { |
| 494 | if (icd_term->DebugReportMessageEXT != NULL) { |
| 495 | icd_term->DebugReportMessageEXT(icd_term->instance, flags, objType, |
| 496 | object, location, msgCode, |
| 497 | pLayerPrefix, pMsg); |
Courtney Goeltzenleuchter | 822e8d7 | 2015-11-30 15:28:25 -0700 | [diff] [blame] | 498 | } |
| 499 | } |
| 500 | |
| 501 | /* |
| 502 | * Now that all ICDs have seen the message, call the necessary callbacks. |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 503 | * Ignoring "bail" return value as there is nothing to bail from at this |
| 504 | * point. |
Courtney Goeltzenleuchter | 822e8d7 | 2015-11-30 15:28:25 -0700 | [diff] [blame] | 505 | */ |
Courtney Goeltzenleuchter | 8288727 | 2015-12-02 15:29:33 -0700 | [diff] [blame] | 506 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 507 | util_DebugReportMessage(inst, flags, objType, object, location, msgCode, |
| 508 | pLayerPrefix, pMsg); |
Courtney Goeltzenleuchter | 8288727 | 2015-12-02 15:29:33 -0700 | [diff] [blame] | 509 | |
| 510 | loader_platform_thread_unlock_mutex(&loader_lock); |
Courtney Goeltzenleuchter | 822e8d7 | 2015-11-30 15:28:25 -0700 | [diff] [blame] | 511 | } |
| 512 | |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 513 | bool debug_report_instance_gpa(struct loader_instance *ptr_instance, |
| 514 | const char *name, void **addr) { |
Jon Ashburn | 8a39efc | 2015-11-06 11:02:40 -0700 | [diff] [blame] | 515 | // debug_report is currently advertised to be supported by the loader, |
| 516 | // so always return the entry points if name matches and it's enabled |
Jon Ashburn | f7a48db | 2015-10-01 12:03:17 -0600 | [diff] [blame] | 517 | *addr = NULL; |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 518 | |
Courtney Goeltzenleuchter | 7415d5a | 2015-12-09 15:48:16 -0700 | [diff] [blame] | 519 | if (!strcmp("vkCreateDebugReportCallbackEXT", name)) { |
Mark Young | 35159af | 2016-09-07 08:50:32 -0600 | [diff] [blame] | 520 | *addr = (ptr_instance->enabled_known_extensions.ext_debug_report == 1) |
| 521 | ? (void *)debug_report_CreateDebugReportCallbackEXT |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 522 | : NULL; |
Jon Ashburn | f7a48db | 2015-10-01 12:03:17 -0600 | [diff] [blame] | 523 | return true; |
| 524 | } |
Courtney Goeltzenleuchter | 7415d5a | 2015-12-09 15:48:16 -0700 | [diff] [blame] | 525 | if (!strcmp("vkDestroyDebugReportCallbackEXT", name)) { |
Mark Young | 35159af | 2016-09-07 08:50:32 -0600 | [diff] [blame] | 526 | *addr = (ptr_instance->enabled_known_extensions.ext_debug_report == 1) |
| 527 | ? (void *)debug_report_DestroyDebugReportCallbackEXT |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 528 | : NULL; |
Jon Ashburn | f7a48db | 2015-10-01 12:03:17 -0600 | [diff] [blame] | 529 | return true; |
| 530 | } |
Courtney Goeltzenleuchter | 7415d5a | 2015-12-09 15:48:16 -0700 | [diff] [blame] | 531 | if (!strcmp("vkDebugReportMessageEXT", name)) { |
Mark Young | 35159af | 2016-09-07 08:50:32 -0600 | [diff] [blame] | 532 | *addr = (ptr_instance->enabled_known_extensions.ext_debug_report == 1) |
| 533 | ? (void *)debug_report_DebugReportMessageEXT |
Jon Ashburn | 23d36b1 | 2016-02-02 17:47:28 -0700 | [diff] [blame] | 534 | : NULL; |
Courtney Goeltzenleuchter | 822e8d7 | 2015-11-30 15:28:25 -0700 | [diff] [blame] | 535 | return true; |
| 536 | } |
Jon Ashburn | f7a48db | 2015-10-01 12:03:17 -0600 | [diff] [blame] | 537 | return false; |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 538 | } |