From 731c5f47f42b977f2a8287d858182cbaaccf9b14 Mon Sep 17 00:00:00 2001 From: Jon Ashburn Date: Mon, 16 May 2016 14:40:36 -0600 Subject: misc: Update to version 1.0.13, header, xml, JSON files Change-Id: Id70c1b709d35b2f508e0dde5f862102c87c80521 --- include/vulkan/vulkan.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'include/vulkan') diff --git a/include/vulkan/vulkan.h b/include/vulkan/vulkan.h index 741da4ce..2f180768 100644 --- a/include/vulkan/vulkan.h +++ b/include/vulkan/vulkan.h @@ -43,7 +43,7 @@ extern "C" { #define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3ff) #define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xfff) // Version of this file -#define VK_HEADER_VERSION 12 +#define VK_HEADER_VERSION 13 #define VK_NULL_HANDLE 0 @@ -3172,13 +3172,14 @@ VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR) #define VK_KHR_SURFACE_SPEC_VERSION 25 #define VK_KHR_SURFACE_EXTENSION_NAME "VK_KHR_surface" +#define VK_COLORSPACE_SRGB_NONLINEAR_KHR VK_COLOR_SPACE_SRGB_NONLINEAR_KHR typedef enum VkColorSpaceKHR { - VK_COLORSPACE_SRGB_NONLINEAR_KHR = 0, - VK_COLOR_SPACE_BEGIN_RANGE_KHR = VK_COLORSPACE_SRGB_NONLINEAR_KHR, - VK_COLOR_SPACE_END_RANGE_KHR = VK_COLORSPACE_SRGB_NONLINEAR_KHR, - VK_COLOR_SPACE_RANGE_SIZE_KHR = (VK_COLORSPACE_SRGB_NONLINEAR_KHR - VK_COLORSPACE_SRGB_NONLINEAR_KHR + 1), + VK_COLOR_SPACE_SRGB_NONLINEAR_KHR = 0, + VK_COLOR_SPACE_BEGIN_RANGE_KHR = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, + VK_COLOR_SPACE_END_RANGE_KHR = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, + VK_COLOR_SPACE_RANGE_SIZE_KHR = (VK_COLOR_SPACE_SRGB_NONLINEAR_KHR - VK_COLOR_SPACE_SRGB_NONLINEAR_KHR + 1), VK_COLOR_SPACE_MAX_ENUM_KHR = 0x7FFFFFFF } VkColorSpaceKHR; -- cgit v1.2.3 From 85032527c79b4158f2d33aefcf9eb4a8df358e60 Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Thu, 19 May 2016 17:17:58 -0600 Subject: headers: GH7, Fix bad variable names in vk_icd.h Change-Id: Ic78792a71ebedbdb5bae68c47856db1c89a714af --- include/vulkan/vk_icd.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'include/vulkan') diff --git a/include/vulkan/vk_icd.h b/include/vulkan/vk_icd.h index fa110f4f..a6493641 100644 --- a/include/vulkan/vk_icd.h +++ b/include/vulkan/vk_icd.h @@ -39,7 +39,7 @@ typedef VkResult (VKAPI_PTR *PFN_vkNegotiateLoaderICDInterfaceVersion)(uint32_t #define ICD_LOADER_MAGIC 0x01CDC0DE -typedef union _VK_LOADER_DATA { +typedef union { uintptr_t loaderMagic; void *loaderData; } VK_LOADER_DATA; @@ -58,7 +58,7 @@ static inline bool valid_loader_magic_value(void *pNewObject) { * Windows and Linux ICDs will treat VkSurfaceKHR as a pointer to a struct that * contains the platform-specific connection and surface information. */ -typedef enum _VkIcdWsiPlatform { +typedef enum { VK_ICD_WSI_PLATFORM_MIR, VK_ICD_WSI_PLATFORM_WAYLAND, VK_ICD_WSI_PLATFORM_WIN32, @@ -67,12 +67,12 @@ typedef enum _VkIcdWsiPlatform { VK_ICD_WSI_PLATFORM_DISPLAY } VkIcdWsiPlatform; -typedef struct _VkIcdSurfaceBase { +typedef struct { VkIcdWsiPlatform platform; } VkIcdSurfaceBase; #ifdef VK_USE_PLATFORM_MIR_KHR -typedef struct _VkIcdSurfaceMir { +typedef struct { VkIcdSurfaceBase base; MirConnection *connection; MirSurface *mirSurface; @@ -80,7 +80,7 @@ typedef struct _VkIcdSurfaceMir { #endif // VK_USE_PLATFORM_MIR_KHR #ifdef VK_USE_PLATFORM_WAYLAND_KHR -typedef struct _VkIcdSurfaceWayland { +typedef struct { VkIcdSurfaceBase base; struct wl_display *display; struct wl_surface *surface; @@ -88,7 +88,7 @@ typedef struct _VkIcdSurfaceWayland { #endif // VK_USE_PLATFORM_WAYLAND_KHR #ifdef VK_USE_PLATFORM_WIN32_KHR -typedef struct _VkIcdSurfaceWin32 { +typedef struct { VkIcdSurfaceBase base; HINSTANCE hinstance; HWND hwnd; @@ -96,7 +96,7 @@ typedef struct _VkIcdSurfaceWin32 { #endif // VK_USE_PLATFORM_WIN32_KHR #ifdef VK_USE_PLATFORM_XCB_KHR -typedef struct _VkIcdSurfaceXcb { +typedef struct { VkIcdSurfaceBase base; xcb_connection_t *connection; xcb_window_t window; @@ -104,14 +104,14 @@ typedef struct _VkIcdSurfaceXcb { #endif // VK_USE_PLATFORM_XCB_KHR #ifdef VK_USE_PLATFORM_XLIB_KHR -typedef struct _VkIcdSurfaceXlib { +typedef struct { VkIcdSurfaceBase base; Display *dpy; Window window; } VkIcdSurfaceXlib; #endif // VK_USE_PLATFORM_XLIB_KHR -typedef struct _VkIcdSurfaceDisplay { +typedef struct { VkIcdSurfaceBase base; VkDisplayModeKHR displayMode; uint32_t planeIndex; -- cgit v1.2.3 From 849ffee6d36b3f7c6e6723c4b62f56822c3741e5 Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Thu, 19 May 2016 15:27:18 -0600 Subject: 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 +++-- layers/core_validation.cpp | 2 +- layers/device_limits.cpp | 2 +- layers/image.cpp | 2 +- layers/parameter_validation.cpp | 2 +- layers/swapchain.cpp | 2 +- layers/threading.cpp | 2 +- layers/vk_layer_config.cpp | 168 ++++++++++++++++-------------------- layers/vk_layer_config.h | 26 +++++- layers/vk_layer_logging.h | 183 +++++++++++++++++++++++----------------- layers/vk_layer_utils.cpp | 29 +++++-- vk-layer-generate.py | 3 +- 12 files changed, 245 insertions(+), 196 deletions(-) (limited to 'include/vulkan') diff --git a/include/vulkan/vk_layer.h b/include/vulkan/vk_layer.h index cf16b2b7..6f49e07f 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 diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 49324b82..b602b7cd 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -9857,7 +9857,7 @@ CreateDebugReportCallbackEXT(VkInstance instance, const VkDebugReportCallbackCre VkResult res = pTable->CreateDebugReportCallbackEXT(instance, pCreateInfo, pAllocator, pMsgCallback); if (VK_SUCCESS == res) { std::lock_guard lock(global_lock); - res = layer_create_msg_callback(my_data->report_data, pCreateInfo, pAllocator, pMsgCallback); + res = layer_create_msg_callback(my_data->report_data, false, pCreateInfo, pAllocator, pMsgCallback); } return res; } diff --git a/layers/device_limits.cpp b/layers/device_limits.cpp index df52cf31..374911b4 100644 --- a/layers/device_limits.cpp +++ b/layers/device_limits.cpp @@ -647,7 +647,7 @@ CreateDebugReportCallbackEXT(VkInstance instance, const VkDebugReportCallbackCre layer_data *my_data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); VkResult res = my_data->instance_dispatch_table->CreateDebugReportCallbackEXT(instance, pCreateInfo, pAllocator, pMsgCallback); if (VK_SUCCESS == res) { - res = layer_create_msg_callback(my_data->report_data, pCreateInfo, pAllocator, pMsgCallback); + res = layer_create_msg_callback(my_data->report_data, false, pCreateInfo, pAllocator, pMsgCallback); } return res; } diff --git a/layers/image.cpp b/layers/image.cpp index 81140e9d..1fb7d5a0 100644 --- a/layers/image.cpp +++ b/layers/image.cpp @@ -90,7 +90,7 @@ CreateDebugReportCallbackEXT(VkInstance instance, const VkDebugReportCallbackCre layer_data *my_data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); VkResult res = my_data->instance_dispatch_table->CreateDebugReportCallbackEXT(instance, pCreateInfo, pAllocator, pMsgCallback); if (res == VK_SUCCESS) { - res = layer_create_msg_callback(my_data->report_data, pCreateInfo, pAllocator, pMsgCallback); + res = layer_create_msg_callback(my_data->report_data, false, pCreateInfo, pAllocator, pMsgCallback); } return res; } diff --git a/layers/parameter_validation.cpp b/layers/parameter_validation.cpp index c70142bb..fe9e391c 100644 --- a/layers/parameter_validation.cpp +++ b/layers/parameter_validation.cpp @@ -111,7 +111,7 @@ CreateDebugReportCallbackEXT(VkInstance instance, const VkDebugReportCallbackCre if (result == VK_SUCCESS) { layer_data *data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); - result = layer_create_msg_callback(data->report_data, pCreateInfo, pAllocator, pMsgCallback); + result = layer_create_msg_callback(data->report_data, false, pCreateInfo, pAllocator, pMsgCallback); } return result; diff --git a/layers/swapchain.cpp b/layers/swapchain.cpp index 1642468d..96691f14 100644 --- a/layers/swapchain.cpp +++ b/layers/swapchain.cpp @@ -2099,7 +2099,7 @@ CreateDebugReportCallbackEXT(VkInstance instance, const VkDebugReportCallbackCre my_data->instance_dispatch_table->CreateDebugReportCallbackEXT(instance, pCreateInfo, pAllocator, pMsgCallback); if (VK_SUCCESS == result) { std::lock_guard lock(global_lock); - result = layer_create_msg_callback(my_data->report_data, pCreateInfo, pAllocator, pMsgCallback); + result = layer_create_msg_callback(my_data->report_data, false, pCreateInfo, pAllocator, pMsgCallback); } return result; } diff --git a/layers/threading.cpp b/layers/threading.cpp index f5d37eba..c69a8b62 100644 --- a/layers/threading.cpp +++ b/layers/threading.cpp @@ -285,7 +285,7 @@ CreateDebugReportCallbackEXT(VkInstance instance, const VkDebugReportCallbackCre VkResult result = my_data->instance_dispatch_table->CreateDebugReportCallbackEXT(instance, pCreateInfo, pAllocator, pMsgCallback); if (VK_SUCCESS == result) { - result = layer_create_msg_callback(my_data->report_data, pCreateInfo, pAllocator, pMsgCallback); + result = layer_create_msg_callback(my_data->report_data, false, pCreateInfo, pAllocator, pMsgCallback); } finishReadObject(my_data, instance); return result; diff --git a/layers/vk_layer_config.cpp b/layers/vk_layer_config.cpp index d67f4053..049ffdcc 100644 --- a/layers/vk_layer_config.cpp +++ b/layers/vk_layer_config.cpp @@ -19,6 +19,7 @@ * Author: Jon Ashburn * Author: Courtney Goeltzenleuchter * Author: Tobin Ehlis + * Author: Mark Lobodzinski **************************************************************************/ #include #include @@ -48,50 +49,10 @@ class ConfigFile { static ConfigFile g_configFileObj; -static VkLayerDbgAction stringToDbgAction(const char *_enum) { - // only handles single enum values - if (!strcmp(_enum, "VK_DBG_LAYER_ACTION_IGNORE")) - return VK_DBG_LAYER_ACTION_IGNORE; - else if (!strcmp(_enum, "VK_DBG_LAYER_ACTION_LOG_MSG")) - return VK_DBG_LAYER_ACTION_LOG_MSG; -#ifdef WIN32 - else if (!strcmp(_enum, "VK_DBG_LAYER_ACTION_DEBUG_OUTPUT")) - return VK_DBG_LAYER_ACTION_DEBUG_OUTPUT; -#endif - else if (!strcmp(_enum, "VK_DBG_LAYER_ACTION_BREAK")) - return VK_DBG_LAYER_ACTION_BREAK; - return (VkLayerDbgAction)0; -} - -static VkFlags stringToDbgReportFlags(const char *_enum) { - // only handles single enum values - if (!strcmp(_enum, "VK_DEBUG_REPORT_INFO")) - return VK_DEBUG_REPORT_INFORMATION_BIT_EXT; - else if (!strcmp(_enum, "VK_DEBUG_REPORT_WARN")) - return VK_DEBUG_REPORT_WARNING_BIT_EXT; - else if (!strcmp(_enum, "VK_DEBUG_REPORT_PERF_WARN")) - return VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT; - else if (!strcmp(_enum, "VK_DEBUG_REPORT_ERROR")) - return VK_DEBUG_REPORT_ERROR_BIT_EXT; - else if (!strcmp(_enum, "VK_DEBUG_REPORT_DEBUG")) - return VK_DEBUG_REPORT_DEBUG_BIT_EXT; - return (VkFlags)0; -} - -static unsigned int convertStringEnumVal(const char *_enum) { - unsigned int ret; - - ret = stringToDbgAction(_enum); - if (ret) - return ret; - - return stringToDbgReportFlags(_enum); -} - const char *getLayerOption(const char *_option) { return g_configFileObj.getOption(_option); } // If option is NULL or stdout, return stdout, otherwise try to open option -// as a filename. If successful, return file handle, otherwise stdout +// as a filename. If successful, return file handle, otherwise stdout FILE *getLayerLogOutput(const char *_option, const char *layerName) { FILE *log_output = NULL; if (!_option || !strcmp("stdout", _option)) @@ -110,64 +71,84 @@ FILE *getLayerLogOutput(const char *_option, const char *layerName) { return log_output; } -VkDebugReportFlagsEXT getLayerOptionFlags(const char *_option, uint32_t optionDefault) { - VkDebugReportFlagsEXT flags = optionDefault; - const char *option = (g_configFileObj.getOption(_option)); - - /* parse comma-separated options */ - while (option) { - const char *p = strchr(option, ','); - size_t len; - - if (p) - len = p - option; - else - len = strlen(option); - - if (len > 0) { - if (strncmp(option, "warn", len) == 0) { - flags |= VK_DEBUG_REPORT_WARNING_BIT_EXT; - } else if (strncmp(option, "info", len) == 0) { - flags |= VK_DEBUG_REPORT_INFORMATION_BIT_EXT; - } else if (strncmp(option, "perf", len) == 0) { - flags |= VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT; - } else if (strncmp(option, "error", len) == 0) { - flags |= VK_DEBUG_REPORT_ERROR_BIT_EXT; - } else if (strncmp(option, "debug", len) == 0) { - flags |= VK_DEBUG_REPORT_DEBUG_BIT_EXT; - } +// Map option strings to flag enum values +VkFlags GetLayerOptionFlags(std::string _option, std::unordered_map const &enum_data, + uint32_t option_default) { + VkDebugReportFlagsEXT flags = option_default; + std::string option_list = g_configFileObj.getOption(_option.c_str()); + + while (option_list.length() != 0) { + + // Find length of option string + std::size_t option_length = option_list.find(","); + if (option_length == option_list.npos) { + option_length = option_list.size(); } - if (!p) - break; + // Get first option in list + const std::string option = option_list.substr(0, option_length); - option = p + 1; - } - return flags; -} + auto enum_value = enum_data.find(option); + if (enum_value != enum_data.end()) { + flags |= enum_value->second; + } -bool getLayerOptionEnum(const char *_option, uint32_t *optionDefault) { - bool res; - const char *option = (g_configFileObj.getOption(_option)); - if (option != NULL) { - *optionDefault = convertStringEnumVal(option); - res = false; - } else { - res = true; + // Remove first option from option_list + option_list.erase(0, option_length); + // Remove possible comma separator + std::size_t char_position = option_list.find(","); + if (char_position == 0) { + option_list.erase(char_position, 1); + } + // Remove possible space + char_position = option_list.find(" "); + if (char_position == 0) { + option_list.erase(char_position, 1); + } } - return res; -} - -void setLayerOptionEnum(const char *_option, const char *_valEnum) { - unsigned int val = convertStringEnumVal(_valEnum); - char strVal[24]; - snprintf(strVal, 24, "%u", val); - g_configFileObj.setOption(_option, strVal); + return flags; } void setLayerOption(const char *_option, const char *_val) { g_configFileObj.setOption(_option, _val); } -ConfigFile::ConfigFile() : m_fileIsParsed(false) {} +// Constructor for ConfigFile. Initialize layers to log error messages to stdout by default. If a vk_layer_settings file is present, +// its settings will override the defaults. +ConfigFile::ConfigFile() : m_fileIsParsed(false) { + m_valueMap["lunarg_device_limits.report_flags"] = "error"; + m_valueMap["lunarg_core_validation.report_flags"] = "error"; + m_valueMap["lunarg_image.report_flags"] = "error"; + m_valueMap["lunarg_object_tracker.report_flags"] = "error"; + m_valueMap["lunarg_parameter_validation.report_flags"] = "error"; + m_valueMap["lunarg_swapchain.report_flags"] = "error"; + m_valueMap["google_threading.report_flags"] = "error"; + +#ifdef WIN32 + // For Windows, enable message logging AND OutputDebugString + m_valueMap["lunarg_device_limits.debug_action"] = "VK_DBG_LAYER_ACTION_DEFAULT,VK_DBG_LAYER_ACTION_LOG_MSG,VK_DBG_LAYER_ACTION_DEBUG_OUTPUT"; + m_valueMap["lunarg_core_validation.debug_action"] = "VK_DBG_LAYER_ACTION_DEFAULT,VK_DBG_LAYER_ACTION_LOG_MSG,VK_DBG_LAYER_ACTION_DEBUG_OUTPUT"; + m_valueMap["lunarg_image.debug_action"] = "VK_DBG_LAYER_ACTION_DEFAULT,VK_DBG_LAYER_ACTION_LOG_MSG,VK_DBG_LAYER_ACTION_DEBUG_OUTPUT"; + m_valueMap["lunarg_object_tracker.debug_action"] = "VK_DBG_LAYER_ACTION_DEFAULT,VK_DBG_LAYER_ACTION_LOG_MSG,VK_DBG_LAYER_ACTION_DEBUG_OUTPUT"; + m_valueMap["lunarg_parameter_validation.debug_action"] = "VK_DBG_LAYER_ACTION_DEFAULT,VK_DBG_LAYER_ACTION_LOG_MSG,VK_DBG_LAYER_ACTION_DEBUG_OUTPUT"; + m_valueMap["lunarg_swapchain.debug_action"] = "VK_DBG_LAYER_ACTION_DEFAULT,VK_DBG_LAYER_ACTION_LOG_MSG,VK_DBG_LAYER_ACTION_DEBUG_OUTPUT"; + m_valueMap["google_threading.debug_action"] = "VK_DBG_LAYER_ACTION_DEFAULT,VK_DBG_LAYER_ACTION_LOG_MSG,VK_DBG_LAYER_ACTION_DEBUG_OUTPUT"; +#else // WIN32 + m_valueMap["lunarg_device_limits.debug_action"] = "VK_DBG_LAYER_ACTION_DEFAULT,VK_DBG_LAYER_ACTION_LOG_MSG"; + m_valueMap["lunarg_core_validation.debug_action"] = "VK_DBG_LAYER_ACTION_DEFAULT,VK_DBG_LAYER_ACTION_LOG_MSG"; + m_valueMap["lunarg_image.debug_action"] = "VK_DBG_LAYER_ACTION_DEFAULT,VK_DBG_LAYER_ACTION_LOG_MSG"; + m_valueMap["lunarg_object_tracker.debug_action"] = "VK_DBG_LAYER_ACTION_DEFAULT,VK_DBG_LAYER_ACTION_LOG_MSG"; + m_valueMap["lunarg_parameter_validation.debug_action"] = "VK_DBG_LAYER_ACTION_DEFAULT,VK_DBG_LAYER_ACTION_LOG_MSG"; + m_valueMap["lunarg_swapchain.debug_action"] = "VK_DBG_LAYER_ACTION_DEFAULT,VK_DBG_LAYER_ACTION_LOG_MSG"; + m_valueMap["google_threading.debug_action"] = "VK_DBG_LAYER_ACTION_DEFAULT,VK_DBG_LAYER_ACTION_LOG_MSG"; +#endif // WIN32 + + m_valueMap["lunarg_device_limits.log_filename"] = "stdout"; + m_valueMap["lunarg_core_validation.log_filename"] = "stdout"; + m_valueMap["lunarg_image.log_filename"] = "stdout"; + m_valueMap["lunarg_object_tracker.log_filename"] = "stdout"; + m_valueMap["lunarg_parameter_validation.log_filename"] = "stdout"; + m_valueMap["lunarg_swapchain.log_filename"] = "stdout"; + m_valueMap["google_threading.log_filename"] = "stdout"; +} ConfigFile::~ConfigFile() {} @@ -178,7 +159,7 @@ const char *ConfigFile::getOption(const std::string &_option) { } if ((it = m_valueMap.find(_option)) == m_valueMap.end()) - return NULL; + return ""; else return it->second.c_str(); } @@ -196,11 +177,12 @@ void ConfigFile::parseFile(const char *filename) { char buf[MAX_CHARS_PER_LINE]; m_fileIsParsed = true; - m_valueMap.clear(); file.open(filename); - if (!file.good()) + if (!file.good()) { return; + } + // read tokens from the file and form option, value pairs file.getline(buf, MAX_CHARS_PER_LINE); diff --git a/layers/vk_layer_config.h b/layers/vk_layer_config.h index 92865f69..8530a977 100644 --- a/layers/vk_layer_config.h +++ b/layers/vk_layer_config.h @@ -15,9 +15,12 @@ * limitations under the License. * * Author: Jon Ashburn + * Author: Mark Lobodzinski **************************************************************************/ #pragma once #include "vulkan/vulkan.h" +#include "vulkan/vk_layer.h" +#include #include #include @@ -25,14 +28,31 @@ extern "C" { #endif +const std::unordered_map debug_actions_option_definitions = { + {std::string("VK_DBG_LAYER_ACTION_IGNORE"), VK_DBG_LAYER_ACTION_IGNORE}, + {std::string("VK_DBG_LAYER_ACTION_CALLBACK"), VK_DBG_LAYER_ACTION_CALLBACK}, + {std::string("VK_DBG_LAYER_ACTION_LOG_MSG"), VK_DBG_LAYER_ACTION_LOG_MSG}, + {std::string("VK_DBG_LAYER_ACTION_BREAK"), VK_DBG_LAYER_ACTION_BREAK}, +#if WIN32 + {std::string("VK_DBG_LAYER_ACTION_DEBUG_OUTPUT"), VK_DBG_LAYER_ACTION_DEBUG_OUTPUT}, +#endif + {std::string("VK_DBG_LAYER_ACTION_DEFAULT"), VK_DBG_LAYER_ACTION_DEFAULT}}; + +const std::unordered_map report_flags_option_definitions = { + {std::string("warn"), VK_DEBUG_REPORT_WARNING_BIT_EXT}, + {std::string("info"), VK_DEBUG_REPORT_INFORMATION_BIT_EXT}, + {std::string("perf"), VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT}, + {std::string("error"), VK_DEBUG_REPORT_ERROR_BIT_EXT}, + {std::string("debug"), VK_DEBUG_REPORT_DEBUG_BIT_EXT}}; + const char *getLayerOption(const char *_option); FILE *getLayerLogOutput(const char *_option, const char *layerName); -VkDebugReportFlagsEXT getLayerOptionFlags(const char *_option, uint32_t optionDefault); -bool getLayerOptionEnum(const char *_option, uint32_t *optionDefault); +VkFlags GetLayerOptionFlags(std::string _option, std::unordered_map const &enum_data, + uint32_t option_default); void setLayerOption(const char *_option, const char *_val); -void setLayerOptionEnum(const char *_option, const char *_valEnum); void print_msg_flags(VkFlags msgFlags, char *msg_flags); + #ifdef __cplusplus } #endif diff --git a/layers/vk_layer_logging.h b/layers/vk_layer_logging.h index 49470b18..cb4c44c7 100644 --- a/layers/vk_layer_logging.h +++ b/layers/vk_layer_logging.h @@ -32,9 +32,11 @@ #include #include #include +#include typedef struct _debug_report_data { - VkLayerDbgFunctionNode *g_pDbgFunctionHead; + VkLayerDbgFunctionNode *debug_callback_list; + VkLayerDbgFunctionNode *default_debug_callback_list; VkFlags active_flags; bool g_DEBUG_REPORT; } debug_report_data; @@ -42,12 +44,78 @@ typedef struct _debug_report_data { template debug_report_data *get_my_data_ptr(void *data_key, std::unordered_map &data_map); +// Forward Declarations +static inline bool debug_report_log_msg(const debug_report_data *debug_data, VkFlags msgFlags, + VkDebugReportObjectTypeEXT objectType, uint64_t srcObject, size_t location, int32_t msgCode, + const char *pLayerPrefix, const char *pMsg); + +// Add a debug message callback node structure to the specified callback linked list +static inline void AddDebugMessageCallback(debug_report_data *debug_data, VkLayerDbgFunctionNode **list_head, + VkLayerDbgFunctionNode *new_node) { + + new_node->pNext = *list_head; + *list_head = new_node; +} + +// Remove specified debug message callback node structure from the specified callback linked list +static inline void RemoveDebugMessageCallback(debug_report_data *debug_data, VkLayerDbgFunctionNode **list_head, + VkDebugReportCallbackEXT callback) { + VkLayerDbgFunctionNode *cur_callback = *list_head; + VkLayerDbgFunctionNode *prev_callback = cur_callback; + bool matched = false; + + debug_data->active_flags = 0; + while (cur_callback) { + if (cur_callback->msgCallback == callback) { + matched = true; + prev_callback->pNext = cur_callback->pNext; + if (*list_head == cur_callback) { + *list_head = cur_callback->pNext; + } + debug_report_log_msg(debug_data, VK_DEBUG_REPORT_DEBUG_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT, + reinterpret_cast(cur_callback->msgCallback), 0, VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT, + "DebugReport", "Destroyed callback"); + } else { + matched = false; + debug_data->active_flags |= cur_callback->msgFlags; + } + prev_callback = cur_callback; + cur_callback = cur_callback->pNext; + if (matched) { + free(prev_callback); + } + } +} + +// Removes all debug callback function nodes from the specified callback linked lists and frees their resources +static inline void RemoveAllMessageCallbacks(debug_report_data *debug_data, VkLayerDbgFunctionNode **list_head) { + VkLayerDbgFunctionNode *current_callback = *list_head; + VkLayerDbgFunctionNode *prev_callback = current_callback; + + while (current_callback) { + prev_callback = current_callback->pNext; + debug_report_log_msg(debug_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT, + (uint64_t)current_callback->msgCallback, 0, VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT, "DebugReport", + "Debug Report callbacks not removed before DestroyInstance"); + free(current_callback); + current_callback = prev_callback; + } + *list_head = NULL; +} + // Utility function to handle reporting -static inline bool debug_report_log_msg(const debug_report_data *debug_data, VkFlags msgFlags, VkDebugReportObjectTypeEXT objectType, - uint64_t srcObject, size_t location, int32_t msgCode, const char *pLayerPrefix, - const char *pMsg) { +static inline bool debug_report_log_msg(const debug_report_data *debug_data, VkFlags msgFlags, + VkDebugReportObjectTypeEXT objectType, uint64_t srcObject, size_t location, int32_t msgCode, + const char *pLayerPrefix, const char *pMsg) { bool bail = false; - VkLayerDbgFunctionNode *pTrav = debug_data->g_pDbgFunctionHead; + VkLayerDbgFunctionNode *pTrav = NULL; + + if (debug_data->debug_callback_list != NULL) { + pTrav = debug_data->debug_callback_list; + } else { + pTrav = debug_data->default_debug_callback_list; + } + while (pTrav) { if (pTrav->msgFlags & msgFlags) { if (pTrav->pfnMsgCallback(msgFlags, objectType, srcObject, location, msgCode, pLayerPrefix, pMsg, pTrav->pUserData)) { @@ -77,7 +145,7 @@ debug_report_create_instance(VkLayerInstanceDispatchTable *table, VkInstance ins memset(debug_data, 0, sizeof(debug_report_data)); for (uint32_t i = 0; i < extension_count; i++) { - /* TODO: Check other property fields */ + // TODO: Check other property fields if (strcmp(ppEnabledExtensions[i], VK_EXT_DEBUG_REPORT_EXTENSION_NAME) == 0) { debug_data->g_DEBUG_REPORT = true; } @@ -86,42 +154,32 @@ debug_report_create_instance(VkLayerInstanceDispatchTable *table, VkInstance ins } static inline void layer_debug_report_destroy_instance(debug_report_data *debug_data) { - VkLayerDbgFunctionNode *pTrav; - VkLayerDbgFunctionNode *pTravNext; - - if (!debug_data) { - return; - } - - pTrav = debug_data->g_pDbgFunctionHead; - /* Clear out any leftover callbacks */ - while (pTrav) { - pTravNext = pTrav->pNext; - - debug_report_log_msg(debug_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT, - (uint64_t)pTrav->msgCallback, 0, VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT, "DebugReport", - "Debug Report callbacks not removed before DestroyInstance"); - - free(pTrav); - pTrav = pTravNext; + if (debug_data) { + RemoveAllMessageCallbacks(debug_data, &debug_data->default_debug_callback_list); + RemoveAllMessageCallbacks(debug_data, &debug_data->debug_callback_list); + free(debug_data); } - debug_data->g_pDbgFunctionHead = NULL; - - free(debug_data); } static inline debug_report_data *layer_debug_report_create_device(debug_report_data *instance_debug_data, VkDevice device) { - /* DEBUG_REPORT shares data between Instance and Device, - * so just return instance's data pointer */ + // DEBUG_REPORT shares data between Instance and Device, + // so just return instance's data pointer return instance_debug_data; } -static inline void layer_debug_report_destroy_device(VkDevice device) { /* Nothing to do since we're using instance data record */ } +static inline void layer_debug_report_destroy_device(VkDevice device) { + // Nothing to do since we're using instance data record +} -static inline VkResult layer_create_msg_callback(debug_report_data *debug_data, +static inline void layer_destroy_msg_callback(debug_report_data *debug_data, VkDebugReportCallbackEXT callback, + const VkAllocationCallbacks *pAllocator) { + RemoveDebugMessageCallback(debug_data, &debug_data->debug_callback_list, callback); + RemoveDebugMessageCallback(debug_data, &debug_data->default_debug_callback_list, callback); +} + +static inline VkResult layer_create_msg_callback(debug_report_data *debug_data, bool default_callback, const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackEXT *pCallback) { - /* TODO: Use app allocator */ VkLayerDbgFunctionNode *pNewDbgFuncNode = (VkLayerDbgFunctionNode *)malloc(sizeof(VkLayerDbgFunctionNode)); if (!pNewDbgFuncNode) return VK_ERROR_OUT_OF_HOST_MEMORY; @@ -133,9 +191,12 @@ static inline VkResult layer_create_msg_callback(debug_report_data *debug_data, pNewDbgFuncNode->pfnMsgCallback = pCreateInfo->pfnCallback; pNewDbgFuncNode->msgFlags = pCreateInfo->flags; pNewDbgFuncNode->pUserData = pCreateInfo->pUserData; - pNewDbgFuncNode->pNext = debug_data->g_pDbgFunctionHead; - debug_data->g_pDbgFunctionHead = pNewDbgFuncNode; + if (default_callback) { + AddDebugMessageCallback(debug_data, &debug_data->default_debug_callback_list, pNewDbgFuncNode); + } else { + AddDebugMessageCallback(debug_data, &debug_data->debug_callback_list, pNewDbgFuncNode); + } debug_data->active_flags |= pCreateInfo->flags; debug_report_log_msg(debug_data, VK_DEBUG_REPORT_DEBUG_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT, @@ -143,36 +204,6 @@ static inline VkResult layer_create_msg_callback(debug_report_data *debug_data, return VK_SUCCESS; } -static inline void layer_destroy_msg_callback(debug_report_data *debug_data, VkDebugReportCallbackEXT callback, - const VkAllocationCallbacks *pAllocator) { - VkLayerDbgFunctionNode *pTrav = debug_data->g_pDbgFunctionHead; - VkLayerDbgFunctionNode *pPrev = pTrav; - bool matched; - - debug_data->active_flags = 0; - while (pTrav) { - if (pTrav->msgCallback == callback) { - matched = true; - pPrev->pNext = pTrav->pNext; - if (debug_data->g_pDbgFunctionHead == pTrav) { - debug_data->g_pDbgFunctionHead = pTrav->pNext; - } - debug_report_log_msg(debug_data, VK_DEBUG_REPORT_DEBUG_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT, - (uint64_t)pTrav->msgCallback, 0, VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT, "DebugReport", - "Destroyed callback"); - } else { - matched = false; - debug_data->active_flags |= pTrav->msgFlags; - } - pPrev = pTrav; - pTrav = pTrav->pNext; - if (matched) { - /* TODO: Use pAllocator */ - free(pPrev); - } - } -} - static inline PFN_vkVoidFunction debug_report_get_instance_proc_addr(debug_report_data *debug_data, const char *funcName) { if (!debug_data || !debug_data->g_DEBUG_REPORT) { return NULL; @@ -253,7 +284,7 @@ static VkResult layer_enable_tmp_callbacks(debug_report_data *debug_data, uint32 VkDebugReportCallbackCreateInfoEXT *infos, VkDebugReportCallbackEXT *callbacks) { VkResult rtn = VK_SUCCESS; for (uint32_t i = 0; i < num_callbacks; i++) { - rtn = layer_create_msg_callback(debug_data, &infos[i], NULL, &callbacks[i]); + rtn = layer_create_msg_callback(debug_data, false, &infos[i], NULL, &callbacks[i]); if (rtn != VK_SUCCESS) { for (uint32_t j = 0; j < i; j++) { layer_destroy_msg_callback(debug_data, callbacks[j], NULL); @@ -273,14 +304,12 @@ static void layer_disable_tmp_callbacks(debug_report_data *debug_data, uint32_t } } -/* - * Checks if the message will get logged. - * Allows layer to defer collecting & formating data if the - * message will be discarded. - */ +// Checks if the message will get logged. +// Allows layer to defer collecting & formating data if the +// message will be discarded. static inline bool will_log_msg(debug_report_data *debug_data, VkFlags msgFlags) { if (!debug_data || !(debug_data->active_flags & msgFlags)) { - /* message is not wanted */ + // Message is not wanted return false; } @@ -302,11 +331,9 @@ static inline int vasprintf(char **strp, char const *fmt, va_list ap) { } #endif -/* - * Output log message via DEBUG_REPORT - * Takes format and variable arg list so that output string - * is only computed if a message needs to be logged - */ +// Output log message via DEBUG_REPORT +// Takes format and variable arg list so that output string +// is only computed if a message needs to be logged #ifndef WIN32 static inline bool log_msg(const debug_report_data *debug_data, VkFlags msgFlags, VkDebugReportObjectTypeEXT objectType, uint64_t srcObject, size_t location, int32_t msgCode, const char *pLayerPrefix, const char *format, ...) @@ -316,7 +343,7 @@ static inline bool log_msg(const debug_report_data *debug_data, VkFlags msgFlags uint64_t srcObject, size_t location, int32_t msgCode, const char *pLayerPrefix, const char *format, ...) { if (!debug_data || !(debug_data->active_flags & msgFlags)) { - /* message is not wanted */ + // Message is not wanted return false; } @@ -324,7 +351,7 @@ static inline bool log_msg(const debug_report_data *debug_data, VkFlags msgFlags va_start(argptr, format); char *str; if (-1 == vasprintf(&str, format, argptr)) { - /* on failure, glibc vasprintf leaves str undefined */ + // On failure, glibc vasprintf leaves str undefined str = nullptr; } va_end(argptr); diff --git a/layers/vk_layer_utils.cpp b/layers/vk_layer_utils.cpp index 1c362706..d028ca65 100644 --- a/layers/vk_layer_utils.cpp +++ b/layers/vk_layer_utils.cpp @@ -604,11 +604,20 @@ VkStringErrorFlags vk_string_validate(const int max_length, const char *utf8) { return result; } +// Debug callbacks get created in three ways: +// o Application-defined debug callbacks +// o Through settings in a vk_layer_settings.txt file +// o By default, if neither an app-defined debug callback nor a vk_layer_settings.txt file is present +// +// At layer initialization time, default logging callbacks are created to output layer error messages. +// If a vk_layer_settings.txt file is present its settings will override any default settings. +// +// If a vk_layer_settings.txt file is present and an application defines a debug callback, both callbacks +// will be active. If no vk_layer_settings.txt file is present, creating an application-defined debug +// callback will cause the default callbacks to be unregisterd and removed. void layer_debug_actions(debug_report_data *report_data, std::vector &logging_callback, - const VkAllocationCallbacks *pAllocator, const char *layer_identifier) { + const VkAllocationCallbacks *pAllocator, const char *layer_identifier) { - uint32_t report_flags = 0; - uint32_t debug_action = 0; VkDebugReportCallbackEXT callback = VK_NULL_HANDLE; std::string report_flags_key = layer_identifier; @@ -618,9 +627,11 @@ void layer_debug_actions(debug_report_data *report_data, std::vectorreport_data,') + r_body.append(' false,') r_body.append(' pCreateInfo,') r_body.append(' pAllocator,') r_body.append(' pCallback);') @@ -311,7 +312,7 @@ class Subcommand(object): r_body.append(' VkResult result = instance_dispatch_table(instance)->CreateDebugReportCallbackEXT(instance, pCreateInfo, pAllocator, pCallback);') r_body.append(' if (VK_SUCCESS == result) {') r_body.append(' layer_data *my_data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map);') - r_body.append(' result = layer_create_msg_callback(my_data->report_data, pCreateInfo, pAllocator, pCallback);') + r_body.append(' result = layer_create_msg_callback(my_data->report_data, false, pCreateInfo, pAllocator, pCallback);') r_body.append(' }') r_body.append(' return result;') r_body.append('}') -- cgit v1.2.3 From 7e03b1a0efe5f2bf6ec16980c9d2a6027b227bb7 Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Tue, 24 May 2016 16:04:56 -0600 Subject: layers: Move debug action enums from vk_layer.h Moved debug-report related items from vk_layer.h. Enums are now in vk_layer_logging.h and DbgFunctionNode has been moved into a new loader header file vk_loader_layer.h. Change-Id: I6031146ba474ff01ca039da44ad5d42d054383a3 --- include/vulkan/vk_layer.h | 23 ----------------------- layers/vk_layer_config.h | 11 +++++++++++ layers/vk_layer_logging.h | 1 + loader/CMakeLists.txt | 1 + loader/loader.h | 3 ++- loader/vk_loader_layer.h | 32 ++++++++++++++++++++++++++++++++ 6 files changed, 47 insertions(+), 24 deletions(-) create mode 100644 loader/vk_loader_layer.h (limited to 'include/vulkan') diff --git a/include/vulkan/vk_layer.h b/include/vulkan/vk_layer.h index 6f49e07f..8b7d82fb 100644 --- a/include/vulkan/vk_layer.h +++ b/include/vulkan/vk_layer.h @@ -234,29 +234,6 @@ 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; - -// 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 diff --git a/layers/vk_layer_config.h b/layers/vk_layer_config.h index 8530a977..c4526dbc 100644 --- a/layers/vk_layer_config.h +++ b/layers/vk_layer_config.h @@ -28,6 +28,17 @@ extern "C" { #endif +// 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; + const std::unordered_map debug_actions_option_definitions = { {std::string("VK_DBG_LAYER_ACTION_IGNORE"), VK_DBG_LAYER_ACTION_IGNORE}, {std::string("VK_DBG_LAYER_ACTION_CALLBACK"), VK_DBG_LAYER_ACTION_CALLBACK}, diff --git a/layers/vk_layer_logging.h b/layers/vk_layer_logging.h index cb4c44c7..0328031f 100644 --- a/layers/vk_layer_logging.h +++ b/layers/vk_layer_logging.h @@ -22,6 +22,7 @@ #ifndef LAYER_LOGGING_H #define LAYER_LOGGING_H +#include "vk_loader_layer.h" #include "vk_layer_config.h" #include "vk_layer_data.h" #include "vk_layer_table.h" diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt index f47ee589..15577b8a 100644 --- a/loader/CMakeLists.txt +++ b/loader/CMakeLists.txt @@ -17,6 +17,7 @@ set(NORMAL_LOADER_SRCS loader.c loader.h vk_loader_platform.h + vk_loader_layer.h trampoline.c wsi.c wsi.h diff --git a/loader/loader.h b/loader/loader.h index 95803c01..ecc945ed 100644 --- a/loader/loader.h +++ b/loader/loader.h @@ -30,8 +30,9 @@ #include #include "vk_loader_platform.h" - +#include "vk_loader_layer.h" #include + #include #include diff --git a/loader/vk_loader_layer.h b/loader/vk_loader_layer.h new file mode 100644 index 00000000..2207c029 --- /dev/null +++ b/loader/vk_loader_layer.h @@ -0,0 +1,32 @@ +/* +* +* Copyright (c) 2016 The Khronos Group Inc. +* Copyright (c) 2016 Valve Corporation +* Copyright (c) 2016 LunarG, Inc. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* +* Author: Mark Lobodzinski +* +*/ +#pragma once + +// Linked list node for tree of debug callback functions +typedef struct VkLayerDbgFunctionNode_ { + VkDebugReportCallbackEXT msgCallback; + PFN_vkDebugReportCallbackEXT pfnMsgCallback; + VkFlags msgFlags; + void *pUserData; + struct VkLayerDbgFunctionNode_ *pNext; +} VkLayerDbgFunctionNode; + -- cgit v1.2.3 From 942d559f93afff87ad04ad7515e9843284f72903 Mon Sep 17 00:00:00 2001 From: Jon Ashburn Date: Mon, 13 Jun 2016 14:10:18 -0600 Subject: misc: Update to Vulkan header version 16 Only change is the addition of AMD extensions. Change-Id: Ia4270600247b2e3f406cdac0cfff3492ec1ce109 --- include/vulkan/vulkan.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'include/vulkan') diff --git a/include/vulkan/vulkan.h b/include/vulkan/vulkan.h index 2f180768..75afd4a7 100644 --- a/include/vulkan/vulkan.h +++ b/include/vulkan/vulkan.h @@ -43,7 +43,7 @@ extern "C" { #define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3ff) #define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xfff) // Version of this file -#define VK_HEADER_VERSION 13 +#define VK_HEADER_VERSION 16 #define VK_NULL_HANDLE 0 @@ -3855,6 +3855,16 @@ typedef struct VkPipelineRasterizationStateRasterizationOrderAMD { +#define VK_AMD_shader_trinary_minmax 1 +#define VK_AMD_SHADER_TRINARY_MINMAX_SPEC_VERSION 1 +#define VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME "VK_AMD_shader_trinary_minmax" + + +#define VK_AMD_shader_explicit_vertex_parameter 1 +#define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_SPEC_VERSION 1 +#define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME "VK_AMD_shader_explicit_vertex_parameter" + + #define VK_EXT_debug_marker 1 #define VK_EXT_DEBUG_MARKER_SPEC_VERSION 3 #define VK_EXT_DEBUG_MARKER_EXTENSION_NAME "VK_EXT_debug_marker" @@ -3912,6 +3922,11 @@ VKAPI_ATTR void VKAPI_CALL vkCmdDebugMarkerInsertEXT( VkDebugMarkerMarkerInfoEXT* pMarkerInfo); #endif +#define VK_AMD_gcn_shader 1 +#define VK_AMD_GCN_SHADER_SPEC_VERSION 1 +#define VK_AMD_GCN_SHADER_EXTENSION_NAME "VK_AMD_gcn_shader" + + #ifdef __cplusplus } #endif -- cgit v1.2.3