diff --git a/OptiScaler/dllmain.cpp b/OptiScaler/dllmain.cpp index b76c3ea9..28a95ebe 100644 --- a/OptiScaler/dllmain.cpp +++ b/OptiScaler/dllmain.cpp @@ -881,8 +881,7 @@ static void CheckWorkingMode() } // SpecialK - if (!Config::Instance()->OverlayMenu.value_or_default() && skModule == nullptr && - Config::Instance()->LoadSpecialK.value_or_default()) + if (skModule == nullptr && Config::Instance()->LoadSpecialK.value_or_default()) { auto skFile = Util::DllPath().parent_path() / L"SpecialK64.dll"; SetEnvironmentVariableW(L"RESHADE_DISABLE_GRAPHICS_HOOK", L"1"); diff --git a/OptiScaler/framegen/ffx/FSRFG_Dx12.cpp b/OptiScaler/framegen/ffx/FSRFG_Dx12.cpp index 9f868671..eb6a5200 100644 --- a/OptiScaler/framegen/ffx/FSRFG_Dx12.cpp +++ b/OptiScaler/framegen/ffx/FSRFG_Dx12.cpp @@ -708,8 +708,7 @@ void FSRFG_Dx12::EvaluateState(ID3D12Device* device, FG_Constants& fgConstants) FfxApiProxy::InitFfxDx12(); // If needed hooks are missing or XeFG proxy is not inited or FG swapchain is not created - if (!Config::Instance()->OverlayMenu.value_or_default() || !FfxApiProxy::IsFGReady() || - State::Instance().currentFGSwapchain == nullptr) + if (!FfxApiProxy::IsFGReady() || State::Instance().currentFGSwapchain == nullptr) return; if (State::Instance().isShuttingDown) diff --git a/OptiScaler/framegen/xefg/XeFG_Dx12.cpp b/OptiScaler/framegen/xefg/XeFG_Dx12.cpp index cc98cab3..6ad09356 100644 --- a/OptiScaler/framegen/xefg/XeFG_Dx12.cpp +++ b/OptiScaler/framegen/xefg/XeFG_Dx12.cpp @@ -623,8 +623,7 @@ void XeFG_Dx12::EvaluateState(ID3D12Device* device, FG_Constants& fgConstants) LOG_FUNC(); // If needed hooks are missing or XeFG proxy is not inited or FG swapchain is not created - if (!Config::Instance()->OverlayMenu.value_or_default() || !XeFGProxy::InitXeFG() || - State::Instance().currentFGSwapchain == nullptr) + if (!XeFGProxy::InitXeFG() || State::Instance().currentFGSwapchain == nullptr) return; if (State::Instance().isShuttingDown) diff --git a/OptiScaler/hooks/Dxgi_Hooks.cpp b/OptiScaler/hooks/Dxgi_Hooks.cpp index 0ceabdfe..a50a2a58 100644 --- a/OptiScaler/hooks/Dxgi_Hooks.cpp +++ b/OptiScaler/hooks/Dxgi_Hooks.cpp @@ -146,6 +146,18 @@ inline static HRESULT hkCreateDXGIFactory2(UINT Flags, REFIID riid, IDXGIFactory void DxgiHooks::Hook() { + // If not spoofing and + // using no frame generation (or Nukem's) and + // not using DXGI spoofing we don't need DXGI hooks + // Probably I forgot something but we can add it later + if (!Config::Instance()->OverlayMenu.value_or_default() && + (Config::Instance()->FGInput.value_or_default() == FGInput::NoFG || + Config::Instance()->FGInput.value_or_default() == FGInput::Nukems) && + !Config::Instance()->DxgiSpoofing.value_or_default()) + { + return; + } + if (o_CreateDXGIFactory != nullptr) return; diff --git a/OptiScaler/hooks/FG_Hooks.cpp b/OptiScaler/hooks/FG_Hooks.cpp index 121e67db..af336a1f 100644 --- a/OptiScaler/hooks/FG_Hooks.cpp +++ b/OptiScaler/hooks/FG_Hooks.cpp @@ -21,8 +21,8 @@ bool CheckForFGStatus() { // Need to check overlay menu parameter, goes to places it shouldn't go - if (!Config::Instance()->OverlayMenu.value_or_default()) - return false; + // if (!Config::Instance()->OverlayMenu.value_or_default()) + // return false; // Disable FG if amd dll is not found if (State::Instance().activeFgOutput == FGOutput::FSRFG) diff --git a/OptiScaler/hooks/LibraryLoad_Hooks.cpp b/OptiScaler/hooks/LibraryLoad_Hooks.cpp index 69699935..47bf55da 100644 --- a/OptiScaler/hooks/LibraryLoad_Hooks.cpp +++ b/OptiScaler/hooks/LibraryLoad_Hooks.cpp @@ -316,7 +316,7 @@ HMODULE LibraryLoadHooks::LoadLibraryCheckW(std::wstring libName, LPCWSTR lpLibF } // Hooks - if (CheckDllNameW(&libName, &dx11NamesW) && Config::Instance()->OverlayMenu.value_or_default()) + if (CheckDllNameW(&libName, &dx11NamesW)) { auto module = NtdllProxy::LoadLibraryExW_Ldr(libName.c_str(), NULL, 0); @@ -326,7 +326,7 @@ HMODULE LibraryLoadHooks::LoadLibraryCheckW(std::wstring libName, LPCWSTR lpLibF return module; } - if (CheckDllNameW(&libName, &dx12NamesW) && Config::Instance()->OverlayMenu.value_or_default()) + if (CheckDllNameW(&libName, &dx12NamesW)) { auto module = NtdllProxy::LoadLibraryExW_Ldr(libName.c_str(), NULL, 0); diff --git a/OptiScaler/inputs/FG/FSR3_Dx12_FG.cpp b/OptiScaler/inputs/FG/FSR3_Dx12_FG.cpp index 19fa3a83..07d03db6 100644 --- a/OptiScaler/inputs/FG/FSR3_Dx12_FG.cpp +++ b/OptiScaler/inputs/FG/FSR3_Dx12_FG.cpp @@ -1292,9 +1292,8 @@ void FSR3FG::SetUpscalerInputs(ID3D12GraphicsCommandList* InCmdList, NVSDK_NGX_P // FG Prepare UINT frameIndex; - if (!State::Instance().isShuttingDown && fg->IsActive() && Config::Instance()->OverlayMenu.value_or_default() && - Config::Instance()->FGEnabled.value_or_default() && !fg->IsPaused() && - State::Instance().currentSwapchain != nullptr) + if (!State::Instance().isShuttingDown && fg->IsActive() && Config::Instance()->FGEnabled.value_or_default() && + !fg->IsPaused() && State::Instance().currentSwapchain != nullptr) { //// Wait for present // if (fg->Mutex.getOwner() == 2) diff --git a/OptiScaler/inputs/FG/Upscaler_Inputs_Dx12.cpp b/OptiScaler/inputs/FG/Upscaler_Inputs_Dx12.cpp index 227ced39..1adac5c5 100644 --- a/OptiScaler/inputs/FG/Upscaler_Inputs_Dx12.cpp +++ b/OptiScaler/inputs/FG/Upscaler_Inputs_Dx12.cpp @@ -129,8 +129,8 @@ void UpscalerInputsDx12::UpscaleStart(ID3D12GraphicsCommandList* InCmdList, NVSD // FG Prepare UINT frameIndex; - if (!State::Instance().isShuttingDown && fg->IsActive() && Config::Instance()->OverlayMenu.value_or_default() && - Config::Instance()->FGEnabled.value_or_default() && State::Instance().currentSwapchain != nullptr) + if (!State::Instance().isShuttingDown && fg->IsActive() && Config::Instance()->FGEnabled.value_or_default() && + State::Instance().currentSwapchain != nullptr) { // Wait for present if (fg->Mutex.getOwner() == 2) @@ -242,8 +242,8 @@ void UpscalerInputsDx12::UpscaleEnd(ID3D12GraphicsCommandList* InCmdList, NVSDK_ return; // FG Dispatch - if (fg->IsActive() && Config::Instance()->OverlayMenu.value_or_default() && - Config::Instance()->FGEnabled.value_or_default() && State::Instance().currentSwapchain != nullptr) + if (fg->IsActive() && Config::Instance()->FGEnabled.value_or_default() && + State::Instance().currentSwapchain != nullptr) { if (Config::Instance()->FGHUDFix.value_or_default()) { diff --git a/OptiScaler/menu/menu_common.cpp b/OptiScaler/menu/menu_common.cpp index 63a41b95..9138c716 100644 --- a/OptiScaler/menu/menu_common.cpp +++ b/OptiScaler/menu/menu_common.cpp @@ -1268,7 +1268,8 @@ static void MenuHdrCheck(ImGuiIO io) { // If game is using HDR, apply tone mapping to the ImGui style if (State::Instance().isHdrActive || - (!Config::Instance()->OverlayMenu.value_or_default() && State::Instance().currentFeature->IsHdr())) + (!Config::Instance()->OverlayMenu.value_or_default() && State::Instance().currentFeature != nullptr && + State::Instance().currentFeature->IsHdr())) { if (!_hdrTonemapApplied) { @@ -2799,7 +2800,14 @@ bool MenuCommon::RenderMenu() // OptiFG requirements auto constexpr optiFgIndex = (uint32_t) FGInput::Upscaler; - if (!Config::Instance()->OverlayMenu.value_or_default()) + + // if (!Config::Instance()->OverlayMenu.value_or_default()) + //{ + // disabledMaskInput[optiFgIndex] = true; + // fgInputDesc[optiFgIndex] = "Old overlay menu is unsupported"; + //} + // else if (State::Instance().api != DX12) + if (State::Instance().api != DX12) { disabledMaskInput[optiFgIndex] = true; fgInputDesc[optiFgIndex] = "Old overlay menu is unsupported"; @@ -3057,8 +3065,7 @@ bool MenuCommon::RenderMenu() // FSR FG controls if (State::Instance().activeFgOutput == FGOutput::FSRFG && - State::Instance().activeFgInput != FGInput::NoFG && - Config::Instance()->OverlayMenu.value_or_default() && !State::Instance().isWorkingAsNvngx && + State::Instance().activeFgInput != FGInput::NoFG && !State::Instance().isWorkingAsNvngx && State::Instance().api == DX12) { if (State::Instance().activeFgInput != FGInput::Upscaler || @@ -3258,8 +3265,7 @@ bool MenuCommon::RenderMenu() // XeFG controls if (State::Instance().activeFgOutput == FGOutput::XeFG && - State::Instance().activeFgInput != FGInput::NoFG && - Config::Instance()->OverlayMenu.value_or_default() && !State::Instance().isWorkingAsNvngx && + State::Instance().activeFgInput != FGInput::NoFG && !State::Instance().isWorkingAsNvngx && State::Instance().api == DX12) { if (State::Instance().activeFgInput != FGInput::Upscaler || @@ -3432,8 +3438,8 @@ bool MenuCommon::RenderMenu() } // OptiFG - if (Config::Instance()->OverlayMenu.value_or_default() && State::Instance().api == DX12 && - !State::Instance().isWorkingAsNvngx && State::Instance().activeFgInput == FGInput::Upscaler) + if (State::Instance().api == DX12 && !State::Instance().isWorkingAsNvngx && + State::Instance().activeFgInput == FGInput::Upscaler) { SeparatorWithHelpMarker("Frame Generation (OptiFG)", "Using upscaler data for FG"); diff --git a/OptiScaler/resource_tracking/ResTrack_dx12.cpp b/OptiScaler/resource_tracking/ResTrack_dx12.cpp index 67ab6383..a324f029 100644 --- a/OptiScaler/resource_tracking/ResTrack_dx12.cpp +++ b/OptiScaler/resource_tracking/ResTrack_dx12.cpp @@ -1799,7 +1799,7 @@ void ResTrack_Dx12::HookToQueue(ID3D12Device* InDevice) void ResTrack_Dx12::HookDevice(ID3D12Device* device) { - if (State::Instance().activeFgInput == FGInput::Nukems || !Config::Instance()->OverlayMenu.value_or_default()) + if (State::Instance().activeFgInput == FGInput::Nukems) return; if (o_CreateDescriptorHeap != nullptr || device == nullptr)