MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-ValidationLayers / ProcessDebugReportSettings

Function ProcessDebugReportSettings

layers/layer_options.cpp:624–860  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

622using VkLayerDbgActionFlags = VkFlags;
623
624static void ProcessDebugReportSettings(ConfigAndEnvSettings* settings_data, VkuLayerSettingSet& layer_setting_set,
625 std::vector<std::string>& setting_warnings) {
626 DebugReport* debug_report = settings_data->debug_report;
627 // Message ID Filtering
628 std::vector<std::string> message_id_filter;
629 if (vkuHasLayerSetting(layer_setting_set, VK_LAYER_MESSAGE_ID_FILTER)) {
630 vkuGetLayerSettingValues(layer_setting_set, VK_LAYER_MESSAGE_ID_FILTER, message_id_filter);
631 }
632 CreateFilterMessageIdList(message_id_filter, debug_report->filter_message_ids);
633
634 // Duplicate message limit
635 bool enable_message_limit = true; // default in JSON
636 uint32_t duplicate_message_limit = 10; // default in JSON
637 if (vkuHasLayerSetting(layer_setting_set, VK_LAYER_ENABLE_MESSAGE_LIMIT)) {
638 vkuGetLayerSettingValue(layer_setting_set, VK_LAYER_ENABLE_MESSAGE_LIMIT, enable_message_limit);
639 }
640 if (enable_message_limit) {
641 if (vkuHasLayerSetting(layer_setting_set, VK_LAYER_DUPLICATE_MESSAGE_LIMIT)) {
642 vkuGetLayerSettingValue(layer_setting_set, VK_LAYER_DUPLICATE_MESSAGE_LIMIT, duplicate_message_limit);
643 }
644 } else {
645 duplicate_message_limit = 0;
646 }
647 debug_report->duplicate_message_limit = duplicate_message_limit;
648
649 if (vkuHasLayerSetting(layer_setting_set, VK_LAYER_MESSAGE_FORMAT_JSON)) {
650 vkuGetLayerSettingValue(layer_setting_set, VK_LAYER_MESSAGE_FORMAT_JSON, debug_report->message_format_settings.json);
651 }
652
653 if (vkuHasLayerSetting(layer_setting_set, VK_LAYER_MESSAGE_FORMAT_DISPLAY_APPLICATION_NAME)) {
654 vkuGetLayerSettingValue(layer_setting_set, VK_LAYER_MESSAGE_FORMAT_DISPLAY_APPLICATION_NAME,
655 debug_report->message_format_settings.display_application_name);
656 }
657
658 std::string log_filename = "stdout"; // Default
659 if (vkuHasLayerSetting(layer_setting_set, VK_LAYER_LOG_FILENAME)) {
660 vkuGetLayerSettingValue(layer_setting_set, VK_LAYER_LOG_FILENAME, log_filename);
661 }
662 const bool is_stdout = log_filename.compare("stdout") == 0;
663
664 // Default
665 std::vector<std::string> debug_actions_list = {"VK_DBG_LAYER_ACTION_DEFAULT", "VK_DBG_LAYER_ACTION_LOG_MSG"};
666#ifdef WIN32
667 // For Windows, enable message logging AND OutputDebugString
668 debug_actions_list.push_back("VK_DBG_LAYER_ACTION_DEBUG_OUTPUT");
669#endif // WIN32
670
671 if (vkuHasLayerSetting(layer_setting_set, VK_LAYER_DEBUG_ACTION)) {
672 vkuGetLayerSettingValues(layer_setting_set, VK_LAYER_DEBUG_ACTION, debug_actions_list);
673 }
674
675 VkLayerDbgActionFlags debug_action = 0;
676 const vvl::unordered_map<std::string, VkFlags> debug_actions_option = {
677 {std::string("VK_DBG_LAYER_ACTION_IGNORE"), VK_DBG_LAYER_ACTION_IGNORE},
678 {std::string("VK_DBG_LAYER_ACTION_CALLBACK"), VK_DBG_LAYER_ACTION_CALLBACK},
679 {std::string("VK_DBG_LAYER_ACTION_LOG_MSG"), VK_DBG_LAYER_ACTION_LOG_MSG},
680 {std::string("VK_DBG_LAYER_ACTION_BREAK"), VK_DBG_LAYER_ACTION_BREAK},
681 {std::string("VK_DBG_LAYER_ACTION_DEBUG_OUTPUT"), VK_DBG_LAYER_ACTION_DEBUG_OUTPUT},

Callers 1

Calls 9

GetLayerLogOutputFunction · 0.85
__android_log_printFunction · 0.85
emplace_backMethod · 0.80
c_strMethod · 0.80
push_backMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected