Skip to content

Commit 4cb2110

Browse files
committed
When possible use number of fake frames from streamline
1 parent a188326 commit 4cb2110

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

OptiScaler/hooks/Reflex_Hooks.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,11 @@ NvAPI_Status ReflexHooks::hkNvAPI_D3D_SetLatencyMarker(IUnknown* pDev,
8181
// magic_enum::enum_name(pSetLatencyMarkerParams->markerType));
8282

8383
// Some games just stop sending any async markers when DLSSG is disabled, so a reset is needed
84-
if (_lastAsyncMarkerFrameId + 10 < pSetLatencyMarkerParams->frameID)
84+
if (_lastAsyncMarkerFrameId + 10 < pSetLatencyMarkerParams->frameID &&
85+
State::Instance().streamlineVersion.major < 2)
86+
{
8587
_FgNumFramesToGenerate = 0;
88+
}
8689

8790
State::Instance().rtssReflexInjection = pSetLatencyMarkerParams->frameID >> 32;
8891

@@ -156,7 +159,8 @@ NvAPI_Status ReflexHooks::hkNvAPI_D3D12_SetAsyncFrameMarker(ID3D12CommandQueue*
156159

157160
_lastAsyncMarkerFrameId = pSetAsyncFrameMarkerParams->frameID;
158161

159-
if (pSetAsyncFrameMarkerParams->markerType == OUT_OF_BAND_PRESENT_START)
162+
if (pSetAsyncFrameMarkerParams->markerType == OUT_OF_BAND_PRESENT_START &&
163+
State::Instance().streamlineVersion.major < 2)
160164
{
161165
constexpr size_t history_size = 20;
162166
static size_t counter = 0;

OptiScaler/hooks/Streamline_Hooks.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,11 @@ sl::Result StreamlineHooks::hkslDLSSGSetOptions(const sl::ViewportHandle& viewpo
651651

652652
LOG_TRACE("DLSSG Modified Mode: {}", magic_enum::enum_name(newOptions.mode));
653653

654+
if (newOptions.mode == sl::DLSSGMode::eOff)
655+
ReflexHooks::setDlssgFrameCount(0);
656+
else
657+
ReflexHooks::setDlssgFrameCount(newOptions.numFramesToGenerate);
658+
654659
return o_slDLSSGSetOptions(viewport, newOptions);
655660
}
656661

0 commit comments

Comments
 (0)