Prevent Fsr4Update from being reset on cards that support FSR 4

This commit is contained in:
FakeMichau
2025-09-30 15:50:56 +02:00
parent 6653447df3
commit 0c8a55f22b
3 changed files with 15 additions and 2 deletions
+2 -1
View File
@@ -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());
+12
View File
@@ -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)
{
+1 -1
View File
@@ -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;
}