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
diff --git a/layers/vk_layer_config.h b/layers/vk_layer_config.h
index 92865f6..8530a97 100644
--- a/layers/vk_layer_config.h
+++ b/layers/vk_layer_config.h
@@ -15,9 +15,12 @@
  * limitations under the License.
  *
  * Author: Jon Ashburn <jon@lunarg.com>
+ * Author: Mark Lobodzinski <mark@lunarg.com>
  **************************************************************************/
 #pragma once
 #include "vulkan/vulkan.h"
+#include "vulkan/vk_layer.h"
+#include <unordered_map>
 #include <stdbool.h>
 #include <stdio.h>
 
@@ -25,14 +28,31 @@
 extern "C" {
 #endif
 
+const std::unordered_map<std::string, VkFlags> 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<std::string, VkFlags> 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<std::string, VkFlags> 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