[util] Improve logging of configuration options

This commit is contained in:
Jens Peters 2018-09-09 13:46:57 +02:00 committed by Philip Rebohle
parent 4439f94955
commit d4947261c6
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
3 changed files with 29 additions and 5 deletions

View File

@ -13,6 +13,7 @@ namespace dxvk {
m_config = Config::getUserConfig();
m_config.merge(Config::getAppConfig(env::getExeName()));
m_config.logOptions();
g_vrInstance.initInstanceExtensions();

View File

@ -13,7 +13,7 @@ namespace dxvk {
const static std::unordered_map<std::string, Config> g_appDefaults = {{
/* Assassin's Creed Syndicate - amdags issues */
{ "ACS.exe", {{
{ "dxgi.customVendorId", "10DE" },
{ "dxgi.customVendorId", "10de" },
}} },
/* Dishonored 2 */
{ "Dishonored2.exe", {{
@ -22,7 +22,7 @@ namespace dxvk {
/* Dragon Quest 2 - keeps searching for NVAPI */
{ "DRAGON QUEST XI.exe", {{
{ "dxgi.customVendorId", "1002" },
{ "dxgi.customDeviceId", "E366" },
{ "dxgi.customDeviceId", "e366" },
}} },
/* F1 2015 */
{ "F1_2015.exe", {{
@ -43,12 +43,12 @@ namespace dxvk {
/* Grand Theft Auto V */
{ "GTA5.exe", {{
{ "dxgi.customVendorId", "1002" },
{ "dxgi.customDeviceId", "E366" },
{ "dxgi.customDeviceId", "e366" },
}} },
/* Batman: Arkham Knight */
{ "BatmanAK.exe", {{
{ "dxgi.customVendorId", "1002" },
{ "dxgi.customDeviceId", "E366" },
{ "dxgi.customDeviceId", "e366" },
}} },
/* Mafia 3 */
{ "mafia3.exe", {{
@ -188,8 +188,13 @@ namespace dxvk {
Config Config::getAppConfig(const std::string& appName) {
auto appConfig = g_appDefaults.find(appName);
if (appConfig != g_appDefaults.end())
if (appConfig != g_appDefaults.end()) {
// Inform the user that we loaded a default config
Logger::info(str::format("Found built-in config: ", appName));
return appConfig->second;
}
return Config();
}
@ -222,4 +227,14 @@ namespace dxvk {
return config;
}
void Config::logOptions() const {
if (!m_options.empty()) {
Logger::info("Effective configuration:");
for (auto& pair : m_options)
Logger::info(str::format(" ", pair.first, " = ", pair.second));
}
}
}

View File

@ -65,6 +65,14 @@ namespace dxvk {
return result;
}
/**
* \brief Logs option values
*
* Prints the effective configuration
* to the log for debugging purposes.
*/
void logOptions() const;
/**
* \brief Retrieves default options for an app
*