mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-05-13 05:00:55 +00:00
Prevent Fsr4Update from being reset on cards that support FSR 4
This commit is contained in:
@@ -764,7 +764,8 @@ bool Config::SaveIni()
|
||||
GetBoolValue(Instance()->FsrUseMaskForTransparency.value_for_config()).c_str());
|
||||
ini.SetValue("FSR", "DlssReactiveMaskBias",
|
||||
GetFloatValue(Instance()->DlssReactiveMaskBias.value_for_config()).c_str());
|
||||
ini.SetValue("FSR", "Fsr4Update", GetBoolValue(Instance()->Fsr4Update.value_for_config()).c_str());
|
||||
ini.SetValue("FSR", "Fsr4Update",
|
||||
GetBoolValue(Instance()->Fsr4Update.value_for_config_ignore_default()).c_str());
|
||||
ini.SetValue("FSR", "Fsr4Model", GetIntValue(Instance()->Fsr4Model.value_for_config()).c_str());
|
||||
ini.SetValue("FSR", "FsrNonLinearColorSpace",
|
||||
GetBoolValue(Instance()->FsrNonLinearColorSpace.value_for_config()).c_str());
|
||||
|
||||
@@ -121,6 +121,18 @@ template <class T, HasDefaultValue defaultState = WithDefault> class CustomOptio
|
||||
return this->value();
|
||||
}
|
||||
|
||||
constexpr std::optional<T> value_for_config_ignore_default()
|
||||
requires(defaultState == WithDefault)
|
||||
{
|
||||
if (_volatile)
|
||||
return _configIni;
|
||||
|
||||
if (this->has_value())
|
||||
return this->value();
|
||||
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
constexpr std::optional<T> value_for_config()
|
||||
requires(defaultState != WithDefault)
|
||||
{
|
||||
|
||||
@@ -139,7 +139,7 @@ class KernelHooks
|
||||
// FSR 4 Init in case of missing amdxc64.dll
|
||||
// 2nd check is amdxcffx64.dll trying to queue amdxc64 but amdxc64 not being loaded
|
||||
if (lpProcName != nullptr && (hModule == amdxc64Mark || hModule == nullptr) &&
|
||||
lstrcmpA(lpProcName, "AmdExtD3DCreateInterface") == 0 && Config::Instance()->Fsr4Update.value_for_config())
|
||||
lstrcmpA(lpProcName, "AmdExtD3DCreateInterface") == 0 && Config::Instance()->Fsr4Update.value_or_default())
|
||||
{
|
||||
return (FARPROC) &hkAmdExtD3DCreateInterface;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user