diff options
Diffstat (limited to 'layers/draw_state.cpp')
| -rw-r--r-- | layers/draw_state.cpp | 47 |
1 files changed, 30 insertions, 17 deletions
diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp index 5ad5ee47..c2afbdc6 100644 --- a/layers/draw_state.cpp +++ b/layers/draw_state.cpp @@ -2569,12 +2569,24 @@ static void init_draw_state(layer_data *my_data, const VkAllocationCallbacks *pA { option_str = getLayerOption("DrawStateLogFilename"); log_output = getLayerLogOutput(option_str, "DrawState"); - layer_create_msg_callback(my_data->report_data, report_flags, log_callback, (void *) log_output, &callback); + VkDebugReportCallbackCreateInfoLUNARG dbgInfo; + memset(&dbgInfo, 0, sizeof(dbgInfo)); + dbgInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_LUNARG; + dbgInfo.pfnCallback = log_callback; + dbgInfo.pUserData = log_output; + dbgInfo.flags = report_flags; + layer_create_msg_callback(my_data->report_data, &dbgInfo, pAllocator, &callback); my_data->logging_callback.push_back(callback); } if (debug_action & VK_DBG_LAYER_ACTION_DEBUG_OUTPUT) { - layer_create_msg_callback(my_data->report_data, report_flags, win32_debug_output_msg, NULL, &callback); + VkDebugReportCallbackCreateInfoLUNARG dbgInfo; + memset(&dbgInfo, 0, sizeof(dbgInfo)); + dbgInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_LUNARG; + dbgInfo.pfnCallback = win32_debug_output_msg; + dbgInfo.pUserData = log_output; + dbgInfo.flags = report_flags; + layer_create_msg_callback(my_data->report_data, &dbgInfo, pAllocator, &callback); my_data->logging_callback.push_back(callback); } @@ -2617,7 +2629,7 @@ VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyInstance(VkInstance instance // Clean up logging callback, if any while (my_data->logging_callback.size() > 0) { VkDebugReportCallbackLUNARG callback = my_data->logging_callback.back(); - layer_destroy_msg_callback(my_data->report_data, callback); + layer_destroy_msg_callback(my_data->report_data, callback, pAllocator); my_data->logging_callback.pop_back(); } @@ -5409,29 +5421,30 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkQueuePresentKHR(VkQueue queue, return VK_ERROR_VALIDATION_FAILED; } -VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkDbgCreateMsgCallback( - VkInstance instance, - VkFlags msgFlags, - const PFN_vkDbgMsgCallback pfnMsgCallback, - void* pUserData, - VkDebugReportCallbackLUNARG* pMsgCallback) +VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDebugReportCallbackLUNARG( + VkInstance instance, + VkDebugReportCallbackCreateInfoLUNARG* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkDebugReportCallbackLUNARG* pMsgCallback) { layer_data* my_data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); - VkResult res = my_data->instance_dispatch_table->DbgCreateMsgCallback(instance, msgFlags, pfnMsgCallback, pUserData, pMsgCallback); + VkLayerInstanceDispatchTable *pTable = my_data->instance_dispatch_table; + VkResult res = pTable->CreateDebugReportCallbackLUNARG(instance, pCreateInfo, pAllocator, pMsgCallback); if (VK_SUCCESS == res) { - res = layer_create_msg_callback(my_data->report_data, msgFlags, pfnMsgCallback, pUserData, pMsgCallback); + res = layer_create_msg_callback(my_data->report_data, pCreateInfo, pAllocator, pMsgCallback); } return res; } -VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkDbgDestroyMsgCallback( - VkInstance instance, - VkDebugReportCallbackLUNARG msgCallback) +VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyDebugReportCallbackLUNARG( + VkInstance instance, + VkDebugReportCallbackLUNARG msgCallback, + const VkAllocationCallbacks* pAllocator) { layer_data* my_data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); - VkResult res = my_data->instance_dispatch_table->DbgDestroyMsgCallback(instance, msgCallback); - layer_destroy_msg_callback(my_data->report_data, msgCallback); - return res; + VkLayerInstanceDispatchTable *pTable = my_data->instance_dispatch_table; + pTable->DestroyDebugReportCallbackLUNARG(instance, msgCallback, pAllocator); + layer_destroy_msg_callback(my_data->report_data, msgCallback, pAllocator); } VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdDbgMarkerBegin(VkCommandBuffer commandBuffer, const char* pMarker) |
