mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-11-16 02:37:50 +00:00
Remove OverlayMenu checks, will implement needed checks at hooks
This commit is contained in:
1 parent
fad2c50e11
commit
01849e7bbc
10 files changed
+40
-26
No files matched your search
@@ -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");
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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())
|
||||
{
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user