aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Ashburn <jon@lunarg.com>2015-10-06 17:20:01 -0600
committerJon Ashburn <jon@lunarg.com>2015-10-07 12:11:29 -0600
commit9ce1bdea5cc06f9ce5bee31cfdb97fe7f2a8b177 (patch)
treeeef4c59236dd4d3d53d15e81ce175d4260ee560d
parent20f47da870a3327752674fa4ab06efe2278ef48a (diff)
downloadusermoji-9ce1bdea5cc06f9ce5bee31cfdb97fe7f2a8b177.tar.xz
layers: Remove obsolete dbg message logging header
-rw-r--r--layers/device_limits.cpp1
-rw-r--r--layers/draw_state.cpp1
-rw-r--r--layers/shader_checker.cpp1
-rw-r--r--layers/vk_layer_msg.h127
-rwxr-xr-xvk-layer-generate.py5
5 files changed, 2 insertions, 133 deletions
diff --git a/layers/device_limits.cpp b/layers/device_limits.cpp
index af9c6e9e..5ea877e0 100644
--- a/layers/device_limits.cpp
+++ b/layers/device_limits.cpp
@@ -44,7 +44,6 @@
// The following is #included again to catch certain OS-specific functions
// being used:
#include "vk_loader_platform.h"
-#include "vk_layer_msg.h"
#include "vk_layer_table.h"
#include "vk_layer_debug_marker_table.h"
#include "vk_layer_data.h"
diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp
index 54530da3..67268e4b 100644
--- a/layers/draw_state.cpp
+++ b/layers/draw_state.cpp
@@ -43,7 +43,6 @@
// The following is #included again to catch certain OS-specific functions
// being used:
#include "vk_loader_platform.h"
-#include "vk_layer_msg.h"
#include "vk_layer_table.h"
#include "vk_layer_debug_marker_table.h"
#include "vk_layer_data.h"
diff --git a/layers/shader_checker.cpp b/layers/shader_checker.cpp
index 6146b94b..9cf7c4f2 100644
--- a/layers/shader_checker.cpp
+++ b/layers/shader_checker.cpp
@@ -34,7 +34,6 @@
#include "vk_dispatch_table_helper.h"
#include "vk_layer.h"
#include "vk_layer_config.h"
-#include "vk_layer_msg.h"
#include "vk_layer_table.h"
#include "vk_layer_logging.h"
#include "vk_enum_string_helper.h"
diff --git a/layers/vk_layer_msg.h b/layers/vk_layer_msg.h
deleted file mode 100644
index 73ecae7a..00000000
--- a/layers/vk_layer_msg.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Vulkan
- *
- * Copyright (C) 2014 LunarG, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-#include <stdio.h>
-#include <stdbool.h>
-#include "vk_layer.h"
-
-static VkLayerDbgFunctionNode *g_pDbgFunctionHead = NULL;
-static VkFlags g_reportFlags = (VkFlags) 0;
-static VkLayerDbgAction g_debugAction = VK_DBG_LAYER_ACTION_LOG_MSG;
-static bool g_actionIsDefault = true;
-static bool g_DEBUG_REPORT = false;
-static FILE *g_logFile = NULL;
-
-static void enable_debug_report(
- uint32_t extension_count,
- const char * const * ppEnabledExtensionNames) // extension name to be enabled
-{
- for (uint32_t i = 0; i < extension_count; i++) {
- /* TODO: Check other property fields */
- if (strcmp(ppEnabledExtensionNames[i], VK_DEBUG_REPORT_EXTENSION_NAME) == 0) {
- g_DEBUG_REPORT = true;
- }
- }
-}
-
-static VkResult layer_create_msg_callback(
- VkInstance instance,
- VkLayerInstanceDispatchTable* nextTable,
- VkFlags msgFlags,
- const PFN_vkDbgMsgCallback pfnMsgCallback,
- void* pUserData,
- VkDbgMsgCallback* pMsgCallback)
-{
- VkLayerDbgFunctionNode *pNewDbgFuncNode = (VkLayerDbgFunctionNode*)malloc(sizeof(VkLayerDbgFunctionNode));
- if (!pNewDbgFuncNode)
- return VK_ERROR_OUT_OF_HOST_MEMORY;
- VkResult result = nextTable->DbgCreateMsgCallback(instance, msgFlags, pfnMsgCallback, pUserData, pMsgCallback);
- if (result == VK_SUCCESS) {
- pNewDbgFuncNode->msgCallback = *pMsgCallback;
- pNewDbgFuncNode->pfnMsgCallback = pfnMsgCallback;
- pNewDbgFuncNode->msgFlags = msgFlags;
- pNewDbgFuncNode->pUserData = pUserData;
- pNewDbgFuncNode->pNext = g_pDbgFunctionHead;
-
- /* TODO: This should be a per-instance resource */
- g_pDbgFunctionHead = pNewDbgFuncNode;
- } else {
- free(pNewDbgFuncNode);
- }
- return result;
-}
-
-static VkResult layer_destroy_msg_callback(
- VkInstance instance,
- VkLayerInstanceDispatchTable *nextTable,
- VkDbgMsgCallback msg_callback)
-{
- VkLayerDbgFunctionNode *pTrav = g_pDbgFunctionHead;
- VkLayerDbgFunctionNode *pPrev = pTrav;
-
- VkResult result = nextTable->DbgDestroyMsgCallback(instance, msg_callback);
-
- while (pTrav) {
- if (pTrav->msgCallback == msg_callback) {
- pPrev->pNext = pTrav->pNext;
- if (g_pDbgFunctionHead == pTrav)
- g_pDbgFunctionHead = pTrav->pNext;
- free(pTrav);
- break;
- }
- pPrev = pTrav;
- pTrav = pTrav->pNext;
- }
-
- return result;
-}
-
-// Utility function to handle reporting
-// If callbacks are enabled, use them, otherwise use printf
-static void layerCbMsg(
- VkFlags msgFlags,
- VkDbgObjectType objectType,
- uint64_t srcObject,
- size_t location,
- int32_t msgCode,
- const char* pLayerPrefix,
- const char* pMsg)
-{
- if (g_logFile == NULL) {
- g_logFile = stdout;
- }
-
- VkLayerDbgFunctionNode *pTrav = g_pDbgFunctionHead;
- while (pTrav) {
- if (pTrav->msgFlags & msgFlags) {
- pTrav->pfnMsgCallback(msgFlags,
- objectType, srcObject,
- location,
- msgCode,
- pLayerPrefix,
- pMsg,
- (void *) pTrav->pUserData);
- }
- pTrav = pTrav->pNext;
- }
-}
diff --git a/vk-layer-generate.py b/vk-layer-generate.py
index 1f4f6b96..0a5a422a 100755
--- a/vk-layer-generate.py
+++ b/vk-layer-generate.py
@@ -590,7 +590,7 @@ class Subcommand(object):
func_body.append(' const char *strOpt;')
func_body.append(' // initialize %s options' % self.layer_name)
func_body.append(' report_flags = getLayerOptionFlags("%sReportFlags", 0);' % self.layer_name)
- func_body.append(' g_actionIsDefault = getLayerOptionEnum("%sDebugAction", (uint32_t *) &debug_action);' % self.layer_name)
+ func_body.append(' getLayerOptionEnum("%sDebugAction", (uint32_t *) &debug_action);' % self.layer_name)
func_body.append('')
func_body.append(' if (debug_action & VK_DBG_LAYER_ACTION_LOG_MSG)')
func_body.append(' {')
@@ -1193,8 +1193,8 @@ class ObjectTrackerSubcommand(Subcommand):
header_txt.append('using namespace std;')
header_txt.append('// The following is #included again to catch certain OS-specific functions being used:')
header_txt.append('#include "vk_loader_platform.h"')
+ header_txt.append('#include "vk_layer.h"')
header_txt.append('#include "vk_layer_config.h"')
- header_txt.append('#include "vk_layer_msg.h"')
header_txt.append('#include "vk_debug_report_lunarg.h"')
header_txt.append('#include "vk_layer_table.h"')
header_txt.append('#include "vk_layer_data.h"')
@@ -1818,7 +1818,6 @@ class ThreadingSubcommand(Subcommand):
header_txt.append('#include "vk_struct_validate_helper.h"')
header_txt.append('//The following is #included again to catch certain OS-specific functions being used:')
header_txt.append('#include "vk_loader_platform.h"')
- header_txt.append('#include "vk_layer_msg.h"')
header_txt.append('#include "vk_layer_table.h"')
header_txt.append('#include "vk_layer_logging.h"')
header_txt.append('')