diff --git a/OptiScaler.ini b/OptiScaler.ini index a0df1e10..a46ef83c 100644 --- a/OptiScaler.ini +++ b/OptiScaler.ini @@ -48,7 +48,7 @@ FGOutput=auto ; Arturs - requires dlss-enabler-headless.dll, FSR 3 MFG ; FFX - requires amd_fidelityfx_dx12.dll OR amd_fidelityfx_loader_dx12.dll + amd_fidelityfx_framegeneration_dx12.dll, FSRFG 3 or 4 ; Combo - requires the same as FFX AND Arturs, uses FFX for middle frames and Enabler for the rest. Allow for combining FSR 4 FG and Enabler in 4x and 6x modes -; None, Nukems, Arturs, FFX, Combo - Default (auto) is None +; None, Nukems, Arturs, FFX, Combo - Default (auto) is Nukems FGNvngxReplacement=auto ; Frametime source, would affect frame pacing diff --git a/OptiScaler/Config.h b/OptiScaler/Config.h index 0294be48..8eee1a8a 100644 --- a/OptiScaler/Config.h +++ b/OptiScaler/Config.h @@ -512,7 +512,7 @@ class Config // Frame Generation CustomOptional FGInput { FGInput::NoFG }; CustomOptional FGOutput { FGOutput::NoFG }; - CustomOptional FGNvngxReplacement { FGNvngxReplacement::None }; + CustomOptional FGNvngxReplacement { FGNvngxReplacement::Nukems }; CustomOptional FGDrawUIOverFG { false }; CustomOptional FGUIPremultipliedAlpha { true }; CustomOptional FGDisableHudless { false }; diff --git a/OptiScaler/menu/menu_common.cpp b/OptiScaler/menu/menu_common.cpp index f823abb6..48c0a1e7 100644 --- a/OptiScaler/menu/menu_common.cpp +++ b/OptiScaler/menu/menu_common.cpp @@ -3202,18 +3202,18 @@ void MenuCommon::RenderFrameGenerationSelection(RenderMenuContext& ctx) // DLSSG output requirements auto constexpr dlssgOutputIndex = (uint32_t) FGOutput::DLSSG; - const bool supportsDlssg = primaryGpu.nvidiaArchInfo.architecture_id >= NV_GPU_ARCHITECTURE_AD100; + const bool maySupportDlssg = primaryGpu.vendorId == VendorId::Nvidia; const bool hasDlssgReplacement = state.nukemsFgFileAvailable || state.artursFgFileAvailable || FfxApiProxy::IsFGReady(false); - if (!supportsDlssg && hasDlssgReplacement) + if (!maySupportDlssg && hasDlssgReplacement) { outputOptions[dlssgOutputIndex].tooltip = "No real DLSSG, unsupported hardware\nOnly Nvngx FG replacements available"; } outputOptions[dlssgOutputIndex].set_disabled(state.swapchainApi == API::Vulkan, "Unsupported API"); - outputOptions[dlssgOutputIndex].set_disabled(!supportsDlssg && !hasDlssgReplacement, + outputOptions[dlssgOutputIndex].set_disabled(!maySupportDlssg && !hasDlssgReplacement, "Unsupported hardware and no replacements"); // For that one case of DX11 DLSSG @@ -3292,7 +3292,7 @@ void MenuCommon::RenderFrameGenerationSelection(RenderMenuContext& ctx) } auto constexpr fgNvngxNoneIndex = (uint32_t) FGNvngxReplacement::None; - nvngxOptions[fgNvngxNoneIndex].set_disabled(!supportsDlssg, "Unsupported hardware"); + nvngxOptions[fgNvngxNoneIndex].set_disabled(!maySupportDlssg, "Unsupported hardware"); if (replaceFgOutputWithNvngx) { @@ -3358,7 +3358,7 @@ void MenuCommon::RenderFrameGenerationSelection(RenderMenuContext& ctx) } // Try to avoid having None selected when the gpu doesn't support DLSSG + some fallbacks - if (!supportsDlssg && (replaceFgOutputWithNvngx || showNvngxFgDowndown) && + if (!maySupportDlssg && (replaceFgOutputWithNvngx || showNvngxFgDowndown) && config->FGNvngxReplacement.value_or_default() == FGNvngxReplacement::None) { if (state.nukemsFgFileAvailable) diff --git a/OptiScaler/misc/IdentifyGpu.cpp b/OptiScaler/misc/IdentifyGpu.cpp index 478734a3..3877f9fe 100644 --- a/OptiScaler/misc/IdentifyGpu.cpp +++ b/OptiScaler/misc/IdentifyGpu.cpp @@ -190,6 +190,16 @@ std::vector IdentifyGpu::checkGpuInfo() if (gpuInfo.vendorId == VendorId::Nvidia) { queryNvapi(gpuInfo); + + // Attempt to use real DLSSG by default on Ada+ + if (gpuInfo.nvidiaArchInfo.architecture_id >= NV_GPU_ARCHITECTURE_AD100 && + !Config::Instance()->FGNvngxReplacement.has_value()) + { + Config::Instance()->FGNvngxReplacement = FGNvngxReplacement::None; + + if (State::Instance().activeFgOutput == FGOutput::DLSSG) + State::Instance().activeFgNvngx = FGNvngxReplacement::None; + } } } diff --git a/OptiScaler/proxies/Streamline_Proxy.h b/OptiScaler/proxies/Streamline_Proxy.h index aa8ffe2b..aa6aaf5b 100644 --- a/OptiScaler/proxies/Streamline_Proxy.h +++ b/OptiScaler/proxies/Streamline_Proxy.h @@ -360,6 +360,27 @@ class StreamlineProxy auto initResult = StreamlineProxy::Init()(pref, sl::kSDKVersion); + sl::AdapterInfo adapterInfo {}; + if (StreamlineProxy::IsFeatureSupported()(sl::kFeatureDLSS_G, adapterInfo) != sl::Result::eOk) + { + if (State::Instance().activeFgNvngx == FGNvngxReplacement::None) + { + Config::Instance()->FGNvngxReplacement = FGNvngxReplacement::Nukems; + Config::Instance()->SaveIni(); + + MessageBoxW(NULL, + L"You've tried to use real DLSSG, but it's not supported\n" + "Opti will try to use a replacement, restart the game", + L"No DLSSG Support", MB_ICONWARNING | MB_OK); + + std::exit(1); + } + else + { + LOG_ERROR("FG Nvngx replacement was selected but SL failed to init DLSSG"); + } + } + State::EnableChecks(owner); if (initResult == sl::Result::eOk)