Skip to content

Commit

Permalink
added some logging, exposure scale. start using nvidia nv params for …
Browse files Browse the repository at this point in the history
…dlss again. added render preset hint checks
  • Loading branch information
cdozdil committed Jun 10, 2024
1 parent d7d9370 commit 6e736e3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
23 changes: 23 additions & 0 deletions OptiScaler/backends/dlss/DLSSFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,11 @@ void DLSSFeature::ProcessEvaluateParams(const NVSDK_NGX_Parameter* InParameters)
if (InParameters->Get(NVSDK_NGX_Parameter_DLSS_Indicator_Invert_Y_Axis, &uintValue) == NVSDK_NGX_Result_Success)
Parameters->Set(NVSDK_NGX_Parameter_DLSS_Indicator_Invert_Y_Axis, uintValue);

if (InParameters->Get(NVSDK_NGX_Parameter_DLSS_Exposure_Scale, &floatValue) == NVSDK_NGX_Result_Success)
Parameters->Set(NVSDK_NGX_Parameter_DLSS_Exposure_Scale, floatValue);
else
Parameters->Set(NVSDK_NGX_Parameter_DLSS_Exposure_Scale, 1.0f);

if (InParameters->Get(NVSDK_NGX_Parameter_FrameTimeDeltaInMsec, &floatValue) == NVSDK_NGX_Result_Success)
Parameters->Set(NVSDK_NGX_Parameter_FrameTimeDeltaInMsec, floatValue);
}
Expand Down Expand Up @@ -743,6 +748,24 @@ void DLSSFeature::ProcessInitParams(const NVSDK_NGX_Parameter* InParameters)
RenderPresetUltraPerformance = Config::Instance()->RenderPresetUltraPerformance.value_or(RenderPresetUltraPerformance);
}

if (RenderPresetDLAA < 0 || RenderPresetDLAA > 5)
RenderPresetDLAA = 0;

if (RenderPresetUltraQuality < 0 || RenderPresetUltraQuality > 5)
RenderPresetUltraQuality = 0;

if (RenderPresetQuality < 0 || RenderPresetQuality > 5)
RenderPresetQuality = 0;

if (RenderPresetBalanced < 0 || RenderPresetBalanced > 5)
RenderPresetBalanced = 0;

if (RenderPresetPerformance < 0 || RenderPresetPerformance > 5)
RenderPresetPerformance = 0;

if (RenderPresetUltraPerformance < 0 || RenderPresetUltraPerformance > 5)
RenderPresetUltraPerformance = 0;

Parameters->Set(NVSDK_NGX_Parameter_DLSS_Hint_Render_Preset_DLAA, RenderPresetDLAA);
Parameters->Set(NVSDK_NGX_Parameter_DLSS_Hint_Render_Preset_UltraQuality, RenderPresetUltraQuality);
Parameters->Set(NVSDK_NGX_Parameter_DLSS_Hint_Render_Preset_Quality, RenderPresetQuality);
Expand Down
3 changes: 1 addition & 2 deletions OptiScaler/backends/dlss/DLSSFeature.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#include "../IFeature.h"
#include "../../pch.h"
#include "../../NVNGX_Parameter.h"
#include <string>

typedef uint32_t(*PFN_NVSDK_NGX_GetSnippetVersion)(void);
Expand All @@ -14,7 +13,7 @@ class DLSSFeature : public virtual IFeature
inline static HMODULE _nvngx = nullptr;

protected:
NVSDK_NGX_Parameter* Parameters = GetNGXParameters("DLSS");
NVSDK_NGX_Parameter* Parameters = nullptr;
NVSDK_NGX_Handle _dlssHandle = {};
NVSDK_NGX_Handle* _p_dlssHandle = nullptr;
inline static bool _dlssInited = false;
Expand Down

0 comments on commit 6e736e3

Please sign in to comment.