diff options
| author | Mark Lobodzinski <mark@lunarg.com> | 2016-03-15 14:21:59 -0600 |
|---|---|---|
| committer | Mark Lobodzinski <mark@lunarg.com> | 2016-03-16 16:37:37 -0600 |
| commit | 0cce4785d303c763e2293dca9b522064bbe5e4c7 (patch) | |
| tree | 4c8a03d9c9079a400a21d21b0778ce6b3fd2f5bf /layers/image.cpp | |
| parent | cc838f0850abf58243bca037288303c05899bc88 (diff) | |
| download | usermoji-0cce4785d303c763e2293dca9b522064bbe5e4c7.tar.xz | |
layers: Move layer debug action initialization into layer_utils
Also removed dead code from the layer generation script.
Change-Id: I64fdcaaf1aed8152de62079568c8e247333d8c61
Diffstat (limited to 'layers/image.cpp')
| -rw-r--r-- | layers/image.cpp | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/layers/image.cpp b/layers/image.cpp index ca7f223f..9d7f6cdb 100644 --- a/layers/image.cpp +++ b/layers/image.cpp @@ -70,35 +70,9 @@ struct layer_data { static unordered_map<void *, layer_data *> layer_data_map; -static void InitImage(layer_data *data, const VkAllocationCallbacks *pAllocator) { - VkDebugReportCallbackEXT callback; - uint32_t report_flags = getLayerOptionFlags("lunarg_image.report_flags", 0); - - uint32_t debug_action = 0; - getLayerOptionEnum("lunarg_image.debug_action", (uint32_t *)&debug_action); - if (debug_action & VK_DBG_LAYER_ACTION_LOG_MSG) { - FILE *log_output = NULL; - const char *option_str = getLayerOption("lunarg_image.log_filename"); - log_output = getLayerLogOutput(option_str, "lunarg_image"); - VkDebugReportCallbackCreateInfoEXT dbgInfo; - memset(&dbgInfo, 0, sizeof(dbgInfo)); - dbgInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT; - dbgInfo.pfnCallback = log_callback; - dbgInfo.pUserData = log_output; - dbgInfo.flags = report_flags; - layer_create_msg_callback(data->report_data, &dbgInfo, pAllocator, &callback); - data->logging_callback.push_back(callback); - } +static void init_image(layer_data *my_data, const VkAllocationCallbacks *pAllocator) { - if (debug_action & VK_DBG_LAYER_ACTION_DEBUG_OUTPUT) { - VkDebugReportCallbackCreateInfoEXT dbgInfo; - memset(&dbgInfo, 0, sizeof(dbgInfo)); - dbgInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT; - dbgInfo.pfnCallback = win32_debug_output_msg; - dbgInfo.flags = report_flags; - layer_create_msg_callback(data->report_data, &dbgInfo, pAllocator, &callback); - data->logging_callback.push_back(callback); - } + layer_debug_actions(my_data->report_data, my_data->logging_callback, pAllocator, "lunarg_image"); } VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL @@ -153,7 +127,7 @@ vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCall my_data->report_data = debug_report_create_instance(my_data->instance_dispatch_table, *pInstance, pCreateInfo->enabledExtensionCount, pCreateInfo->ppEnabledExtensionNames); - InitImage(my_data, pAllocator); + init_image(my_data, pAllocator); return result; } |
