revise menu for DLSS, DLSS-G & FSR-FG options

This commit is contained in:
cdozdil
2025-01-29 13:57:23 +03:00
parent dec14e41e2
commit e6265b0611
3 changed files with 66 additions and 8 deletions
+3
View File
@@ -28,6 +28,8 @@ public:
// DLSSG
GameQuirk gameQuirk = GameQuirk::Other;
bool NukemsFilesAvailable = false;
bool DlssGIsActive = false;
// FSR Common
float lastFsrCameraNear = 0.0f;
@@ -39,6 +41,7 @@ public:
bool SCchanged = false;
bool skipHeapCapture = false;
bool useThreadingForHeaps = false;
bool FsrFgIsActive = false;
bool FGcaptureResources = false;
int FGcapturedResourceCount = false;
+6
View File
@@ -2275,6 +2275,8 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv
HookFSR2ExeInputs();
spdlog::info("");
CheckQuirks();
spdlog::info("");
CheckQuirks();
@@ -2290,6 +2292,10 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv
State::Instance().skipDllLoadChecks = false;
// Initial state of FSR-FG
State::Instance().FsrFgIsActive = Config::Instance()->FGUseFGSwapChain.value_or_default();
State::Instance().DlssGIsActive = Config::Instance()->DLSSGMod.value_or_default();
for (size_t i = 0; i < 300; i++)
{
State::Instance().frameTimes.push_back(0.0f);
+57 -8
View File
@@ -3,6 +3,7 @@
#include "font/Hack_Compressed.h"
#include <nvapi/fakenvapi.h>
#include <nvapi/ReflexHooks.h>
#include <proxies/FfxApi_Proxy.h>
#include <imgui/imgui_internal.h>
@@ -778,6 +779,8 @@ bool MenuCommon::RenderMenu()
if (_isVisible)
{
Config::Instance()->ReloadFakenvapi();
auto dllPath = Util::DllPath().parent_path() / "dlssg_to_fsr3_amd_is_better.dll";
State::Instance().NukemsFilesAvailable = std::filesystem::exists(dllPath);
if (pfn_ClipCursor_hooked)
{
@@ -1201,17 +1204,29 @@ bool MenuCommon::RenderMenu()
if (ImGui::Button("Revert"))
State::Instance().newBackend = "";
}
// DYNAMIC PROPERTIES -----------------------------
}
// Frame Generation
if (Config::Instance()->FGUseFGSwapChain.value_or_default() && Config::Instance()->OverlayMenu.value_or_default() &&
State::Instance().api == DX12 && !State::Instance().isWorkingAsNvngx)
if (Config::Instance()->OverlayMenu.value_or_default() && State::Instance().api == DX12 && !State::Instance().isWorkingAsNvngx)
{
ImGui::SeparatorText("Frame Generation (Dx12)");
ImGui::SeparatorText("Frame Generation (OptiFG)");
auto fsrFgActive = Config::Instance()->FGUseFGSwapChain.value_or_default();
if (ImGui::Checkbox("Frame Generation Enabled", &fsrFgActive))
{
Config::Instance()->FGUseFGSwapChain = fsrFgActive;
if (fsrFgActive)
Config::Instance()->DLSSGMod = false;
else
Config::Instance()->DLSSGMod.reset();
}
ShowHelpMarker("These settings will become active on next boot!");
if (State::Instance().FsrFgIsActive && currentFeature != nullptr && FfxApiProxy::InitFfxDx12())
{
bool fgActive = Config::Instance()->FGEnabled.value_or_default();
if (ImGui::Checkbox("Frame Generation", &fgActive))
if (ImGui::Checkbox("FG Active", &fgActive))
{
Config::Instance()->FGEnabled = fgActive;
LOG_DEBUG("Enabled set FGEnabled: {}", fgActive);
@@ -1220,7 +1235,7 @@ bool MenuCommon::RenderMenu()
State::Instance().FGchanged = true;
}
ShowHelpMarker("Enable FSR frame generation");
ShowHelpMarker("Enable frame generation (OptiFG)");
bool fgHudfix = Config::Instance()->FGHUDFix.value_or_default();
if (ImGui::Checkbox("FG HUD Fix", &fgHudfix))
@@ -1420,9 +1435,33 @@ bool MenuCommon::RenderMenu()
}
// DLSSG Mod
if (Config::Instance()->DLSSGMod.value_or_default() && State::Instance().api != DX11 && !State::Instance().isWorkingAsNvngx) {
if (State::Instance().api != DX11 && !State::Instance().isWorkingAsNvngx)
{
ImGui::SeparatorText("Frame Generation (DLSSG)");
auto dlssgEnabled = Config::Instance()->DLSSGMod.value_or_default();
if (ImGui::Checkbox("DLSSG Enabled", &dlssgEnabled))
{
Config::Instance()->DLSSGMod = dlssgEnabled;
if (dlssgEnabled)
Config::Instance()->FGUseFGSwapChain = false;
else
Config::Instance()->FGUseFGSwapChain.reset();
}
ShowHelpMarker("These settings will become active on next boot!");
if(Config::Instance()->DLSSGMod.value_or_default() && !State::Instance().NukemsFilesAvailable)
ImGui::TextColored(ImVec4(1.f, 0.f, 0.f, 1.f), "Please put dlssg_to_fsr3_amd_is_better.dll next to OptiScaler");
if (Config::Instance()->AdvancedSettings.value_or_default())
{
auto hagsSpoofing = Config::Instance()->SpoofHAGS.value_or(dlssgEnabled);
if (ImGui::Checkbox("HAGS Spoofing Enabled", &hagsSpoofing))
Config::Instance()->SpoofHAGS = hagsSpoofing;
}
if (State::Instance().DlssGIsActive) {
if (!ReflexHooks::isReflexHooked()) {
ImGui::TextColored(ImVec4(1.f, 0.f, 0.f, 1.f), "Reflex not hooked");
ImGui::Text("If you are using an AMD/Intel GPU then make sure you have fakenvapi");
@@ -1444,6 +1483,7 @@ bool MenuCommon::RenderMenu()
ShowHelpMarker("Makes a copy of the depth buffer\nCan fix broken visuals in some games on AMD GPUs under Windows\nCan cause stutters so best to use only when necessary");
}
}
}
if (currentFeature != nullptr) {
// Dx11 with Dx12
@@ -1621,6 +1661,7 @@ bool MenuCommon::RenderMenu()
}
}
// FSR Common -----------------
if (Config::Instance()->FGUseFGSwapChain.value_or_default() || currentBackend.rfind("fsr", 0) == 0)
{
SeparatorWithHelpMarker("FSR Common Settings", "Affects both FSR-FG & Upscalers");
@@ -1729,6 +1770,14 @@ bool MenuCommon::RenderMenu()
AddRenderPreset("Balanced Preset", &Config::Instance()->RenderPresetBalanced);
AddRenderPreset("Perf Preset", &Config::Instance()->RenderPresetPerformance);
AddRenderPreset("UltraP Preset", &Config::Instance()->RenderPresetUltraPerformance);
bool appIdOverride = Config::Instance()->UseGenericAppIdWithDlss.value_or_default();
if (ImGui::Checkbox("Use Generic App Id with DLSS", &appIdOverride))
Config::Instance()->UseGenericAppIdWithDlss = appIdOverride;
ShowHelpMarker("Use generic appid with NGX\n"
"Fixes OptiScaler preset override not working with certain games\n"
"Requires a game restart.");
}
// RCAS -----------------