diff options
| author | Courtney Goeltzenleuchter <courtney@LunarG.com> | 2015-06-14 11:33:06 -0600 |
|---|---|---|
| committer | Courtney Goeltzenleuchter <courtney@LunarG.com> | 2015-06-18 10:22:56 -0600 |
| commit | ccddfe96f5c6f30879bf05e4cef0ab49b4bd39de (patch) | |
| tree | dd73474181916a3c985c16916043fe4e31a0d3a9 /layers | |
| parent | e11ee846bbf144a303e68460690f51c8991943c1 (diff) | |
| download | usermoji-ccddfe96f5c6f30879bf05e4cef0ab49b4bd39de.tar.xz | |
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.
Diffstat (limited to 'layers')
| -rw-r--r-- | layers/layers_config.cpp | 30 | ||||
| -rw-r--r-- | layers/layers_config.h | 1 |
2 files changed, 31 insertions, 0 deletions
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 |
