From ccddfe96f5c6f30879bf05e4cef0ab49b4bd39de Mon Sep 17 00:00:00 2001 From: Courtney Goeltzenleuchter Date: Sun, 14 Jun 2015 11:33:06 -0600 Subject: layers: Move dbg flag print to config header The print function seems to go better here with the config file parsing as they use similar values. --- layers/layers_config.cpp | 30 ++++++++++++++++++++++++++++++ layers/layers_config.h | 1 + 2 files changed, 31 insertions(+) (limited to 'layers') diff --git a/layers/layers_config.cpp b/layers/layers_config.cpp index 5f726640..845389c8 100644 --- a/layers/layers_config.cpp +++ b/layers/layers_config.cpp @@ -191,3 +191,33 @@ void ConfigFile::parseFile(const char *filename) } } +void print_msg_flags(VkFlags msgFlags, char *msg_flags) +{ + bool separator = false; + + msg_flags[0] = 0; + if (msgFlags & VK_DBG_REPORT_DEBUG_BIT) { + strcat(msg_flags, "DEBUG"); + separator = true; + } + if (msgFlags & VK_DBG_REPORT_INFO_BIT) { + if (separator) strcat(msg_flags, ","); + strcat(msg_flags, "INFO"); + separator = true; + } + if (msgFlags & VK_DBG_REPORT_WARN_BIT) { + if (separator) strcat(msg_flags, ","); + strcat(msg_flags, "WARN"); + separator = true; + } + if (msgFlags & VK_DBG_REPORT_PERF_WARN_BIT) { + if (separator) strcat(msg_flags, ","); + strcat(msg_flags, "PERF"); + separator = true; + } + if (msgFlags & VK_DBG_REPORT_ERROR_BIT) { + if (separator) strcat(msg_flags, ","); + strcat(msg_flags, "ERROR"); + } +} + diff --git a/layers/layers_config.h b/layers/layers_config.h index 7b608d78..3a232e27 100644 --- a/layers/layers_config.h +++ b/layers/layers_config.h @@ -34,6 +34,7 @@ bool getLayerOptionEnum(const char *_option, uint32_t *optionDefault); 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 -- cgit v1.2.3