From 0cce4785d303c763e2293dca9b522064bbe5e4c7 Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Tue, 15 Mar 2016 14:21:59 -0600 Subject: layers: Move layer debug action initialization into layer_utils Also removed dead code from the layer generation script. Change-Id: I64fdcaaf1aed8152de62079568c8e247333d8c61 --- layers/device_limits.cpp | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) (limited to 'layers/device_limits.cpp') diff --git a/layers/device_limits.cpp b/layers/device_limits.cpp index 75422bc5..cda1ae70 100644 --- a/layers/device_limits.cpp +++ b/layers/device_limits.cpp @@ -84,38 +84,8 @@ static loader_platform_thread_mutex globalLock; template layer_data *get_my_data_ptr(void *data_key, std::unordered_map &data_map); static void init_device_limits(layer_data *my_data, const VkAllocationCallbacks *pAllocator) { - uint32_t report_flags = 0; - uint32_t debug_action = 0; - FILE *log_output = NULL; - const char *option_str; - VkDebugReportCallbackEXT callback; - // initialize device_limits options - report_flags = getLayerOptionFlags("lunarg_device_limits.report_flags", 0); - getLayerOptionEnum("lunarg_device_limits.debug_action", (uint32_t *)&debug_action); - - if (debug_action & VK_DBG_LAYER_ACTION_LOG_MSG) { - option_str = getLayerOption("lunarg_device_limits.log_filename"); - log_output = getLayerLogOutput(option_str, "lunarg_device_limits"); - VkDebugReportCallbackCreateInfoEXT dbgCreateInfo; - memset(&dbgCreateInfo, 0, sizeof(dbgCreateInfo)); - dbgCreateInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT; - dbgCreateInfo.flags = report_flags; - dbgCreateInfo.pfnCallback = log_callback; - dbgCreateInfo.pUserData = (void *)log_output; - layer_create_msg_callback(my_data->report_data, &dbgCreateInfo, pAllocator, &callback); - my_data->logging_callback.push_back(callback); - } - if (debug_action & VK_DBG_LAYER_ACTION_DEBUG_OUTPUT) { - VkDebugReportCallbackCreateInfoEXT dbgCreateInfo; - memset(&dbgCreateInfo, 0, sizeof(dbgCreateInfo)); - dbgCreateInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT; - dbgCreateInfo.flags = report_flags; - dbgCreateInfo.pfnCallback = win32_debug_output_msg; - dbgCreateInfo.pUserData = NULL; - layer_create_msg_callback(my_data->report_data, &dbgCreateInfo, pAllocator, &callback); - my_data->logging_callback.push_back(callback); - } + layer_debug_actions(my_data->report_data, my_data->logging_callback, pAllocator, "lunarg_device_limits"); if (!globalLockInitialized) { // TODO/TBD: Need to delete this mutex sometime. How??? One -- cgit v1.2.3