From 947f5046289e200f4cdfd45bea16f7a76cf28330 Mon Sep 17 00:00:00 2001 From: cdozdil Date: Sat, 21 Dec 2024 16:08:14 +0300 Subject: [PATCH] added fsr inputs info --- OptiScaler/FSR2_Dx12.cpp | 6 ++++++ OptiScaler/FSR3_Dx12.cpp | 6 ++++++ OptiScaler/FfxApi_Proxy.h | 2 ++ OptiScaler/imgui/imgui_common.cpp | 8 +++++--- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/OptiScaler/FSR2_Dx12.cpp b/OptiScaler/FSR2_Dx12.cpp index 5c270aab..1d0ab637 100644 --- a/OptiScaler/FSR2_Dx12.cpp +++ b/OptiScaler/FSR2_Dx12.cpp @@ -818,6 +818,8 @@ void HookFSR2ExeInputs() if (o_ffxGetDeviceDX12 != nullptr) DetourAttach(&(PVOID&)o_ffxGetDeviceDX12, o_ffxGetDeviceDX12); + Config::Instance()->fsrHooks = true; + DetourTransactionCommit(); } @@ -877,6 +879,8 @@ void HookFSR2Dx12Inputs(HMODULE module) if (o_ffxGetDeviceDX12 != nullptr) DetourAttach(&(PVOID&)o_ffxGetDeviceDX12, hk_ffxGetDeviceDX12); + Config::Instance()->fsrHooks = true; + DetourTransactionCommit(); } @@ -930,6 +934,8 @@ void HookFSR2Inputs(HMODULE module) if (o_ffxFsr2GetRenderResolutionFromQualityMode_Dx12 != nullptr) DetourAttach(&(PVOID&)o_ffxFsr2GetRenderResolutionFromQualityMode_Dx12, ffxFsr2GetRenderResolutionFromQualityMode_Dx12); + Config::Instance()->fsrHooks = true; + DetourTransactionCommit(); } diff --git a/OptiScaler/FSR3_Dx12.cpp b/OptiScaler/FSR3_Dx12.cpp index 6e0e9ead..c184debe 100644 --- a/OptiScaler/FSR3_Dx12.cpp +++ b/OptiScaler/FSR3_Dx12.cpp @@ -443,6 +443,8 @@ void HookFSR3ExeInputs() if (o_ffxFsr3UpscalerResourceIsNull != nullptr) DetourAttach(&(PVOID&)o_ffxFsr3UpscalerResourceIsNull, ffxFsr3UpscalerResourceIsNull); + Config::Instance()->fsrHooks = true; + DetourTransactionCommit(); } @@ -490,6 +492,8 @@ void HookFSR3Dx12Inputs(HMODULE module) if (o_ffxGetFSR3ResourceDX12 != nullptr) DetourAttach(&(PVOID&)o_ffxGetFSR3ResourceDX12, hk_ffxFsr3GetResourceDX12); + Config::Instance()->fsrHooks = true; + DetourTransactionCommit(); } @@ -551,6 +555,8 @@ void HookFSR3Inputs(HMODULE module) if (o_ffxFsr3UpscalerResourceIsNull != nullptr) DetourAttach(&(PVOID&)o_ffxFsr3UpscalerResourceIsNull, ffxFsr3UpscalerResourceIsNull); + Config::Instance()->fsrHooks = true; + DetourTransactionCommit(); } diff --git a/OptiScaler/FfxApi_Proxy.h b/OptiScaler/FfxApi_Proxy.h index 6f10ce9f..5cc81039 100644 --- a/OptiScaler/FfxApi_Proxy.h +++ b/OptiScaler/FfxApi_Proxy.h @@ -94,6 +94,8 @@ public: if (_D3D12_Query != nullptr) DetourAttach(&(PVOID&)_D3D12_Query, ffxQuery_Dx12); + Config::Instance()->fsrHooks = true; + DetourTransactionCommit(); } diff --git a/OptiScaler/imgui/imgui_common.cpp b/OptiScaler/imgui/imgui_common.cpp index d160e844..5c082b2e 100644 --- a/OptiScaler/imgui/imgui_common.cpp +++ b/OptiScaler/imgui/imgui_common.cpp @@ -838,9 +838,11 @@ void ImGuiCommon::RenderMenu() if (Config::Instance()->nvngxExist || Config::Instance()->libxessExist) { ImGui::Spacing(); - ImGui::Text("Please select %s%s%s as upscaler\nfrom game options and enter the game\nto enable upscaler settings.\n", - Config::Instance()->nvngxExist ? "DLSS" : "", - Config::Instance()->nvngxExist && Config::Instance()->libxessExist ? " or " : "", + ImGui::Text("Please select %s%s%s%s%s as upscaler\nfrom game options and enter the game\nto enable upscaler settings.\n", + Config::Instance()->fsrHooks ? "FSR" : "", + Config::Instance()->fsrHooks && (Config::Instance()->nvngxExist || Config::Instance()->IsRunningOnNvidia) ? " or " : "", + (Config::Instance()->nvngxExist || Config::Instance()->IsRunningOnNvidia) ? "DLSS" : "", + ((Config::Instance()->nvngxExist || Config::Instance()->IsRunningOnNvidia) || Config::Instance()->fsrHooks) && Config::Instance()->libxessExist ? " or " : "", Config::Instance()->libxessExist ? "XeSS" : "");