[dxvk] Add config option to enable the HUD

This commit is contained in:
Philip Rebohle 2019-08-01 12:37:55 +02:00
parent 4fd41f8550
commit af15d85baa
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
4 changed files with 21 additions and 3 deletions

View File

@ -210,4 +210,13 @@
# - Auto: Don't change the default
# - True, False: Always enable / disable
# dxvk.useEarlyDiscard = Auto
# dxvk.useEarlyDiscard = Auto
# Sets enabled HUD elements
#
# Behaves like the DXVK_HUD environment variable if the
# environment variable is not set, otherwise it will be
# ignored. The syntax is identical.
# dxvk.hud =

View File

@ -8,6 +8,7 @@ namespace dxvk {
numCompilerThreads = config.getOption<int32_t> ("dxvk.numCompilerThreads", 0);
useRawSsbo = config.getOption<Tristate>("dxvk.useRawSsbo", Tristate::Auto);
useEarlyDiscard = config.getOption<Tristate>("dxvk.useEarlyDiscard", Tristate::Auto);
hud = config.getOption<std::string>("dxvk.hud", "");
}
}

View File

@ -21,6 +21,9 @@ namespace dxvk {
/// Shader-related options
Tristate useRawSsbo;
Tristate useEarlyDiscard;
/// HUD elements
std::string hud;
};
}

View File

@ -59,8 +59,13 @@ namespace dxvk::hud {
Rc<Hud> Hud::createHud(const Rc<DxvkDevice>& device) {
HudConfig config(env::getEnvVar("DXVK_HUD"));
std::string hudElements = env::getEnvVar("DXVK_HUD");
if (hudElements.empty())
hudElements = device->config().hud;
HudConfig config(hudElements);
return !config.elements.isClear()
? new Hud(device, config)
: nullptr;