From 52a063d4fd94a2d969b5620b383775eacc415d0d Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Thu, 19 May 2016 15:27:18 -0600 Subject: [PATCH] layers: Add default layer error message config Allows layers to output error messages even if no vk_layer_settings.txt config file is present. Sets defaults to LOG_MSG, error, stdout. A layer settings file will override any default values. If no settings file is present and an app creates a debug callback, the default callbacks will be removed and unregistered. Change-Id: I49f37189665816df58c258b9e9629f2bf76751c8 --- include/vulkan/vk_layer.h | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/include/vulkan/vk_layer.h b/include/vulkan/vk_layer.h index cf16b2b..6f49e07 100644 --- a/include/vulkan/vk_layer.h +++ b/include/vulkan/vk_layer.h @@ -234,22 +234,28 @@ typedef struct VkLayerInstanceDispatchTable_ { CreateDisplayPlaneSurfaceKHR; } VkLayerInstanceDispatchTable; + // LL node for tree of dbg callback functions typedef struct VkLayerDbgFunctionNode_ { VkDebugReportCallbackEXT msgCallback; PFN_vkDebugReportCallbackEXT pfnMsgCallback; VkFlags msgFlags; void *pUserData; + bool default_callback; struct VkLayerDbgFunctionNode_ *pNext; } VkLayerDbgFunctionNode; -typedef enum VkLayerDbgAction_ { - VK_DBG_LAYER_ACTION_IGNORE = 0x0, - VK_DBG_LAYER_ACTION_CALLBACK = 0x1, - VK_DBG_LAYER_ACTION_LOG_MSG = 0x2, - VK_DBG_LAYER_ACTION_BREAK = 0x4, - VK_DBG_LAYER_ACTION_DEBUG_OUTPUT = 0x8, -} VkLayerDbgAction; +// TODO: Move debug action definitions out of this header file +// Definitions for Debug Actions +typedef enum VkLayerDbgActionBits { + VK_DBG_LAYER_ACTION_IGNORE = 0x00000000, + VK_DBG_LAYER_ACTION_CALLBACK = 0x00000001, + VK_DBG_LAYER_ACTION_LOG_MSG = 0x00000002, + VK_DBG_LAYER_ACTION_BREAK = 0x00000004, + VK_DBG_LAYER_ACTION_DEBUG_OUTPUT = 0x00000008, + VK_DBG_LAYER_ACTION_DEFAULT = 0x40000000, +} VkLayerDbgActionBits; +typedef VkFlags VkLayerDbgActionFlags; // ------------------------------------------------------------------------------------------------ // CreateInstance and CreateDevice support structures