mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-08-26 08:06:33 +00:00
added drs & input resolution rounding settings
This commit is contained in:
@@ -101,9 +101,13 @@ bool Config::Reload()
|
||||
JitterCancellation = readBool("MotionVectors", "JitterCancellation");
|
||||
DisplayResolution = readBool("MotionVectors", "DisplayResolution");
|
||||
|
||||
|
||||
// DRS
|
||||
DrsMinOverrideEnabled = readBool("DRS", "DrsMinOverrideEnabled");
|
||||
DrsMaxOverrideEnabled = readBool("DRS", "DrsMaxOverrideEnabled");
|
||||
|
||||
//Upscale Ratio Override
|
||||
UpscaleRatioOverrideEnabled = readBool("UpscaleRatio", "UpscaleRatioOverrideEnabled");
|
||||
DrsMaxOverrideEnabled = readBool("UpscaleRatio", "DrsMaxOverrideEnabled");
|
||||
UpscaleRatioOverrideValue = readFloat("UpscaleRatio", "UpscaleRatioOverrideValue");
|
||||
|
||||
// Quality Overrides
|
||||
@@ -117,6 +121,7 @@ bool Config::Reload()
|
||||
|
||||
// hotfixes
|
||||
DisableReactiveMask = readBool("Hotfix", "DisableReactiveMask");
|
||||
RoundInternalResolution = readInt("Hotfix", "RoundInternalResolution");
|
||||
MipmapBiasOverride = readFloat("Hotfix", "MipmapBiasOverride");
|
||||
|
||||
if (MipmapBiasOverride.has_value() && (MipmapBiasOverride.value() > 15.0 || MipmapBiasOverride.value() < -15.0))
|
||||
|
||||
+5
-1
@@ -67,9 +67,12 @@ public:
|
||||
|
||||
// Upscale Ratio Override
|
||||
std::optional<bool> UpscaleRatioOverrideEnabled;
|
||||
std::optional<bool> DrsMaxOverrideEnabled;
|
||||
std::optional<float> UpscaleRatioOverrideValue;
|
||||
|
||||
// DRS
|
||||
std::optional<bool> DrsMinOverrideEnabled;
|
||||
std::optional<bool> DrsMaxOverrideEnabled;
|
||||
|
||||
// Quality Overrides
|
||||
std::optional<bool> QualityRatioOverrideEnabled;
|
||||
std::optional<float> QualityRatio_DLAA;
|
||||
@@ -81,6 +84,7 @@ public:
|
||||
|
||||
//Hotfixes
|
||||
std::optional<bool> DisableReactiveMask;
|
||||
std::optional<int> RoundInternalResolution;
|
||||
std::optional<float> MipmapBiasOverride;
|
||||
std::optional<bool> RestoreComputeSignature;
|
||||
std::optional<bool> RestoreGraphicSignature;
|
||||
|
||||
@@ -41,6 +41,7 @@ inline std::optional<float> GetQualityOverrideRatio(const NVSDK_NGX_PerfQuality_
|
||||
output = Config::Instance()->QualityRatio_Balanced.value_or(1.7);
|
||||
break;
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
@@ -121,12 +122,19 @@ inline NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_DLSS_GetOptimalSettingsCallback(NVS
|
||||
}
|
||||
}
|
||||
|
||||
if (Config::Instance()->RoundInternalResolution.has_value())
|
||||
{
|
||||
OutHeight -= OutHeight % Config::Instance()->RoundInternalResolution.value();
|
||||
OutWidth -= OutWidth % Config::Instance()->RoundInternalResolution.value();
|
||||
}
|
||||
|
||||
InParams->Set(NVSDK_NGX_Parameter_Scale, scalingRatio);
|
||||
InParams->Set(NVSDK_NGX_Parameter_SuperSampling_ScaleFactor, scalingRatio);
|
||||
InParams->Set(NVSDK_NGX_Parameter_OutWidth, OutWidth);
|
||||
InParams->Set(NVSDK_NGX_Parameter_OutHeight, OutHeight);
|
||||
|
||||
if (Config::Instance()->QualityRatioOverrideEnabled.value_or(false) || Config::Instance()->UpscaleRatioOverrideEnabled.value_or(false))
|
||||
// DRS minimum resolution
|
||||
if (Config::Instance()->DrsMinOverrideEnabled.value_or(false))
|
||||
{
|
||||
InParams->Set(NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Min_Render_Width, OutWidth);
|
||||
InParams->Set(NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Min_Render_Height, OutHeight);
|
||||
@@ -138,10 +146,23 @@ inline NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_DLSS_GetOptimalSettingsCallback(NVS
|
||||
}
|
||||
else
|
||||
{
|
||||
InParams->Set(NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Min_Render_Width, (unsigned int)((float)Width / 3.0f));
|
||||
InParams->Set(NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Min_Render_Height, (unsigned int)((float)Height / 3.0f));
|
||||
// DLSS normally only supports DRS in range of 0.5 and 1.0
|
||||
auto drsMinWidth = (unsigned int)((float)Width * 0.5f);
|
||||
auto drsMinHeight = (unsigned int)((float)Height * 0.5f);
|
||||
|
||||
if (OutWidth < drsMinWidth || OutHeight < drsMinHeight)
|
||||
{
|
||||
InParams->Set(NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Min_Render_Width, OutWidth);
|
||||
InParams->Set(NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Min_Render_Height, OutHeight);
|
||||
}
|
||||
else
|
||||
{
|
||||
InParams->Set(NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Min_Render_Width, drsMinWidth);
|
||||
InParams->Set(NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Min_Render_Height, drsMinHeight);
|
||||
}
|
||||
}
|
||||
|
||||
// DRS maximum resolution
|
||||
if (Config::Instance()->DrsMaxOverrideEnabled.value_or(false))
|
||||
{
|
||||
InParams->Set(NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Max_Render_Width, OutWidth);
|
||||
|
||||
@@ -890,6 +890,21 @@ void Imgui_Base::RenderMenu()
|
||||
|
||||
ImGui::EndDisabled();
|
||||
|
||||
// DRS -----------------------------
|
||||
ImGui::SeparatorText("DRS (Dynamic Resolution Scaling)");
|
||||
if (ImGui::BeginTable("drs", 2))
|
||||
{
|
||||
ImGui::TableNextColumn();
|
||||
if (bool drsMin = Config::Instance()->DrsMinOverrideEnabled.value_or(false); ImGui::Checkbox("Override Minimum", &drsMin))
|
||||
Config::Instance()->DrsMinOverrideEnabled = drsMin;
|
||||
|
||||
ImGui::TableNextColumn();
|
||||
if (bool drsMax = Config::Instance()->DrsMaxOverrideEnabled.value_or(false); ImGui::Checkbox("Override Maximum", &drsMax))
|
||||
Config::Instance()->DrsMaxOverrideEnabled = drsMax;
|
||||
|
||||
ImGui::EndTable();
|
||||
}
|
||||
|
||||
// INIT -----------------------------
|
||||
ImGui::SeparatorText("Init Flags");
|
||||
if (ImGui::BeginTable("init", 2))
|
||||
@@ -1188,7 +1203,7 @@ bool Imgui_Base::IsHandleDifferent()
|
||||
{
|
||||
DWORD procId;
|
||||
|
||||
HWND frontWindow = GetForegroundWindow(); // Util::GetProcessWindow(); -- for linux compatibility
|
||||
HWND frontWindow = GetForegroundWindow();
|
||||
GetWindowThreadProcessId(frontWindow, &procId);
|
||||
|
||||
if (processId != procId)
|
||||
|
||||
@@ -176,10 +176,6 @@ DisplayResolution=auto
|
||||
; true or false - Default (auto) is false
|
||||
UpscaleRatioOverrideEnabled=auto
|
||||
|
||||
; Set this to true to enable limiting DRS max resolution to overriden ratio
|
||||
; true or false - Default (auto) is false
|
||||
DrsMaxOverrideEnabled=auto
|
||||
|
||||
; Set the forced upscale ratio value
|
||||
; Default (auto) is 1.3
|
||||
UpscaleRatioOverrideValue=auto
|
||||
@@ -205,6 +201,15 @@ QualityRatioBalanced=auto
|
||||
QualityRatioPerformance=auto
|
||||
QualityRatioUltraPerformance=auto
|
||||
|
||||
[DRS]
|
||||
; Set this to true to enable limiting DRS min resolution to rendering resolution
|
||||
; true or false - Default (auto) is false
|
||||
DrsMinOverrideEnabled=auto
|
||||
|
||||
; Set this to true to enable limiting DRS max resolution to rendering resolution
|
||||
; true or false - Default (auto) is false
|
||||
DrsMaxOverrideEnabled=auto
|
||||
|
||||
[Hotfix]
|
||||
; Force remove RESPONSIVE_PIXEL_MASK from init flags
|
||||
; true or false - Default (auto) is true
|
||||
@@ -214,6 +219,10 @@ DisableReactiveMask=auto
|
||||
; -15.0 - 15.0 - Default (auto) is disabled
|
||||
MipmapBiasOverride=auto
|
||||
|
||||
; Rounds internal resolutions width and height to multiple of this value
|
||||
; 2, 4, 8, 16 ... - Default (auto) is disabled
|
||||
RoundInternalResolution=auto
|
||||
|
||||
; Restore last used compute signature after upscaling
|
||||
; true or false - Default (auto) is false
|
||||
RestoreComputeSignature=auto
|
||||
@@ -229,23 +238,18 @@ RestoreGraphicSignature=auto
|
||||
; Default (auto) is state correction disabled
|
||||
ColorResourceBarrier=auto
|
||||
|
||||
; MotionVector texture resource state, from this to D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE (for mostly debugging)
|
||||
; Default (auto) is state correction disabled
|
||||
MotionVectorResourceBarrier=auto
|
||||
|
||||
; Depth texture resource state, from this D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE (for mostly debugging)
|
||||
; Default (auto) is state correction disabled
|
||||
DepthResourceBarrier=auto
|
||||
|
||||
; Color mask texture resource state, from this D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE (for mostly debugging)
|
||||
; Default (auto) is state correction disabled
|
||||
ColorMaskResourceBarrier=auto
|
||||
|
||||
; Exposure texture resource state, from this D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE (for mostly debugging)
|
||||
; Default (auto) is state correction disabled
|
||||
ExposureResourceBarrier=auto
|
||||
|
||||
; Output texture resource state, from this D3D12_RESOURCE_STATE_UNORDERED_ACCESS (for mostly debugging)
|
||||
; Default (auto) is state correction disabled
|
||||
OutputResourceBarrier=auto
|
||||
|
||||
|
||||
Reference in New Issue
Block a user