mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-08-26 16:17:01 +00:00
Add support for DLSSG DispatchFlags
This commit is contained in:
@@ -281,6 +281,20 @@ OverrideForceDMFG=auto
|
||||
; Default (auto) is 0.0 (monitor's refresh rate)
|
||||
FramerateTargetDMFG=auto
|
||||
|
||||
; Any set of flags is accepted, for example 0x14100000
|
||||
; For reference https://github.com/artur-graniszewski/dlss-enabler-main/blob/a92464d468eb0d91ae17befa66c6bf6229f20b9f/Utils/DlssgProxy.cpp#L1033
|
||||
; Any set of flags - Default (auto) is 0
|
||||
DispatchFlags = auto
|
||||
|
||||
; Controls value set to DLSSG.ShowDebug
|
||||
; uint32_t - Default (auto) is 0
|
||||
ShowDebug = auto
|
||||
|
||||
; Disable hudless resource being sent to DLSSG
|
||||
; Might be required for some sets of DispatchFlags, see the reference
|
||||
; true or false - Default (auto) is false
|
||||
DisableHudless = auto
|
||||
|
||||
|
||||
; -------------------------------------------------------
|
||||
[OptiFG]
|
||||
|
||||
@@ -225,6 +225,9 @@ bool Config::Reload(std::filesystem::path iniPath)
|
||||
|
||||
FGDLSSGFramerateTargetDMFG.set_from_config(readFloat("DLSSG", "FramerateTargetDMFG"));
|
||||
FGDLSSGOverrideForceDMFG.set_from_config(readBool("DLSSG", "OverrideForceDMFG"));
|
||||
FGDLSSGDispatchFlags.set_from_config(readUInt("DLSSG", "DispatchFlags"));
|
||||
FGDLSSGShowDebug.set_from_config(readUInt("DLSSG", "ShowDebug"));
|
||||
FGDLSSGDisableHudless.set_from_config(readBool("DLSSG", "DisableHudless"));
|
||||
}
|
||||
|
||||
// FSR FG Inputs
|
||||
@@ -937,6 +940,11 @@ bool Config::SaveIni()
|
||||
GetFloatValue(Instance()->FGDLSSGFramerateTargetDMFG.value_for_config()).c_str());
|
||||
ini.SetValue("DLSSG", "OverrideForceDMFG",
|
||||
GetBoolValue(Instance()->FGDLSSGOverrideForceDMFG.value_for_config()).c_str());
|
||||
ini.SetValue("DLSSG", "DispatchFlags",
|
||||
GetIntValue(Instance()->FGDLSSGDispatchFlags.value_for_config()).c_str());
|
||||
ini.SetValue("DLSSG", "ShowDebug", GetIntValue(Instance()->FGDLSSGShowDebug.value_for_config()).c_str());
|
||||
ini.SetValue("DLSSG", "DisableHudless",
|
||||
GetBoolValue(Instance()->FGDLSSGDisableHudless.value_for_config()).c_str());
|
||||
}
|
||||
|
||||
// OptiFG
|
||||
|
||||
@@ -574,6 +574,12 @@ class Config
|
||||
CustomOptional<bool> FGDLSSGForceDMFG { false }; // Overrides Opti's DLSSG mode to Dynamic
|
||||
CustomOptional<float> FGDLSSGFramerateTargetDMFG { 0.0f }; // 0.0 means auto-detects the display refresh rate
|
||||
|
||||
// As per
|
||||
// https://github.com/artur-graniszewski/dlss-enabler-main/blob/a92464d468eb0d91ae17befa66c6bf6229f20b9f/Utils/DlssgProxy.cpp#L1033
|
||||
CustomOptional<uint32_t> FGDLSSGDispatchFlags { 0 };
|
||||
CustomOptional<uint32_t> FGDLSSGShowDebug { 0 };
|
||||
CustomOptional<bool> FGDLSSGDisableHudless { false };
|
||||
|
||||
// fakenvapi
|
||||
CustomOptional<bool> UseFakenvapi { true };
|
||||
CustomOptional<bool> ForceXeLL { false };
|
||||
|
||||
@@ -457,6 +457,19 @@ NVSDK_NGX_Result Nvngx_FG::D3D12_EvaluateFeature(ID3D12GraphicsCommandList* InCm
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t showDebug = Config::Instance()->FGDLSSGShowDebug.value_or_default();
|
||||
uint32_t flags = Config::Instance()->FGDLSSGDispatchFlags.value_or_default();
|
||||
bool disableHudless = Config::Instance()->FGDLSSGDisableHudless.value_or_default();
|
||||
|
||||
if (showDebug)
|
||||
InParameters->Set("DLSSG.ShowDebug", showDebug);
|
||||
|
||||
if (flags)
|
||||
InParameters->Set("DLSSG.DispatchFlags", flags);
|
||||
|
||||
if (disableHudless)
|
||||
InParameters->Set("DLSSG.HUDLess", (void*) nullptr);
|
||||
|
||||
NVSDK_NGX_Handle TempHandle = { .Id = InFeatureHandle->Id - DLSSG_MOD_ID_OFFSET };
|
||||
return _DLSSG_D3D12_EvaluateFeature(InCmdList, &TempHandle, InParameters, InCallback);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user