diff --git a/src/Features/Upscaling.cpp b/src/Features/Upscaling.cpp index b5aa79e708..b8acb6d288 100644 --- a/src/Features/Upscaling.cpp +++ b/src/Features/Upscaling.cpp @@ -23,7 +23,8 @@ NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT( frameGenerationForceEnable, streamlineLogLevel, sharpnessFSR, - sharpnessDLSS); + sharpnessDLSS, + presetDLSS); decltype(&D3D11CreateDeviceAndSwapChain) ptrD3D11CreateDeviceAndSwapChainUpscaling; @@ -227,6 +228,15 @@ void Upscaling::DrawSettings() ImGui::SliderFloat("Sharpness", &settings.sharpnessFSR, 0.0f, 1.0f, "%.1f"); } else if (upscaleMethod == UpscaleMethod::kDLSS) { ImGui::SliderFloat("Sharpness", &settings.sharpnessDLSS, 0.0f, 1.0f, "%.1f"); + + const char* presets[] = { "Default", "Preset J", "Preset K", "Preset L", "Preset M" }; + ImGui::Combo("DLSS Model Preset", (int*)&settings.presetDLSS, presets, 5); + if (auto _tt = Util::HoverTooltipWrapper()) { + ImGui::Text("Choose which DLSS AI model preset to use."); + ImGui::Text("Each model offers different visual quality, performance, and motion stability."); + ImGui::Text("Set to 'Default' for automatic selection based on your Upscale Preset and hardware."); + ImGui::Text("Changing this setting requires a restart to take effect."); + } } } @@ -432,6 +442,10 @@ void Upscaling::LoadSettings(json& o_json) logger::warn("[Upscaling] Loaded upscaleMethodNoDLSS {} out of range, clamping to {}", settings.upscaleMethodNoDLSS, enumCount ? enumCount - 1 : 0); settings.upscaleMethodNoDLSS = enumCount ? enumCount - 1 : 0; } + if (settings.presetDLSS > 4) { + logger::warn("[Upscaling] Loaded presetDLSS {} out of range, resetting to 0 (Default)", settings.presetDLSS); + settings.presetDLSS = 0; + } auto iniSettingCollection = globals::game::iniPrefSettingCollection; if (iniSettingCollection) { auto setting = iniSettingCollection->GetSetting("bUseTAA:Display"); diff --git a/src/Features/Upscaling.h b/src/Features/Upscaling.h index d7451a93b9..38c8192dfd 100644 --- a/src/Features/Upscaling.h +++ b/src/Features/Upscaling.h @@ -59,6 +59,7 @@ struct Upscaling : Feature uint streamlineLogLevel = 0; // 0=Off, 1=Default, 2=Verbose float sharpnessFSR = 0.0f; float sharpnessDLSS = 0.0f; + uint presetDLSS = 0; // 0=Default, 1=J, 2=K, 3=L, 4=M }; Settings settings; diff --git a/src/Features/Upscaling/Streamline.cpp b/src/Features/Upscaling/Streamline.cpp index ed88c3119a..71eb3a3542 100644 --- a/src/Features/Upscaling/Streamline.cpp +++ b/src/Features/Upscaling/Streamline.cpp @@ -344,7 +344,30 @@ void Streamline::SetDLSSOptions(sl::ViewportHandle p_viewport, uint32_t width) } dlssOptions.useAutoExposure = sl::Boolean::eTrue; - if (isRTXBelow40series) { + std::optional customPreset; + switch (globals::features::upscaling.settings.presetDLSS) { + case 1: + customPreset = sl::DLSSPreset::ePresetJ; + break; + case 2: + customPreset = sl::DLSSPreset::ePresetK; + break; + case 3: + customPreset = sl::DLSSPreset::ePresetL; + break; + case 4: + customPreset = sl::DLSSPreset::ePresetM; + break; + } + + if (customPreset.has_value()) { + dlssOptions.dlaaPreset = customPreset.value(); + dlssOptions.ultraQualityPreset = customPreset.value(); + dlssOptions.qualityPreset = customPreset.value(); + dlssOptions.balancedPreset = customPreset.value(); + dlssOptions.performancePreset = customPreset.value(); + dlssOptions.ultraPerformancePreset = customPreset.value(); + } else if (isRTXBelow40series) { dlssOptions.dlaaPreset = sl::DLSSPreset::ePresetJ; dlssOptions.ultraQualityPreset = sl::DLSSPreset::ePresetJ; dlssOptions.qualityPreset = sl::DLSSPreset::ePresetJ;