Skip to content

Commit a6f193f

Browse files
committed
Seed the MFG ceiling into the driver's parameter object as well
Intercepting NVNGX_Parameters::Get only reaches the custom backend. With DLSS enabled and the driver's NGX module loaded, GetCapabilityParameters and AllocateParameters hand back the driver's own object and OptiScaler seeds it through InitNGXParameters instead, so the read cannot be intercepted at all. That is Cyberpunk's arrangement, and the arrangement the interception was written for. Seed DLSSG.MultiFrameCountMax there when the patches landed. The existing frame generation block owns the count whenever it runs, so this is held below it and skipped while OptiScaler generates the frames itself.
1 parent 208e64f commit a6f193f

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎OptiScaler/NVNGX_Parameter.cpp‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,19 @@ void InitNGXParameters(NVSDK_NGX_Parameter* InParams, API api)
834834
InParams->Set("FrameGeneration.MinDriverVersionMajor", 0);
835835
}
836836
}
837+
838+
// Where DLSS is enabled and the driver's NGX module is loaded, the object handed back is the
839+
// driver's own rather than an NVNGX_Parameters, so the read cannot be intercepted -- seeding it
840+
// is the only way in. Held below the block above, which owns the count whenever it runs.
841+
if (State::Instance().activeFgNvngx == FGNvngxReplacement::None)
842+
{
843+
// Streamline asks for capabilities several times while it maps its plugins, so a seed that
844+
// finds the snippet absent gets another attempt before the count is validated.
845+
MfgUnlock::TryApply();
846+
847+
if (auto unlockedMax = MfgUnlock::UnlockedMax(); unlockedMax > 0)
848+
InParams->Set("DLSSG.MultiFrameCountMax", (int) unlockedMax);
849+
}
837850
}
838851

839852
NVNGX_Parameters* GetNGXParameters(API api, bool isPersistent)

0 commit comments

Comments
 (0)