Skip to content

Commit

Permalink
[util] Improve logging of configuration options
Browse files Browse the repository at this point in the history
  • Loading branch information
jp7677 authored and doitsujin committed Sep 14, 2018
1 parent 4439f94 commit d494726
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/dxvk/dxvk_instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace dxvk {

m_config = Config::getUserConfig();
m_config.merge(Config::getAppConfig(env::getExeName()));
m_config.logOptions();

g_vrInstance.initInstanceExtensions();

Expand Down
25 changes: 20 additions & 5 deletions src/util/config/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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", {{
Expand All @@ -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", {{
Expand All @@ -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", {{
Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -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));
}
}

}
8 changes: 8 additions & 0 deletions src/util/config/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down

0 comments on commit d494726

Please sign in to comment.