mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-08-29 17:46:34 +00:00
Use Upscaler input logic for DLSSGFG inputs
This commit is contained in:
@@ -731,7 +731,8 @@ void FSRFG_Dx12::EvaluateState(ID3D12Device* device, FG_Constants& fgConstants)
|
||||
CreateContext(device, fgConstants);
|
||||
|
||||
// Pause for 10 frames
|
||||
if (State::Instance().activeFgInput == FGInput::Upscaler)
|
||||
if (State::Instance().activeFgInput == FGInput::Upscaler ||
|
||||
State::Instance().activeFgInput == FGInput::DLSSG)
|
||||
UpdateTarget();
|
||||
}
|
||||
// If there is a change deactivate it
|
||||
@@ -740,7 +741,8 @@ void FSRFG_Dx12::EvaluateState(ID3D12Device* device, FG_Constants& fgConstants)
|
||||
Deactivate();
|
||||
|
||||
// Pause for 10 frames
|
||||
if (State::Instance().activeFgInput == FGInput::Upscaler)
|
||||
if (State::Instance().activeFgInput == FGInput::Upscaler ||
|
||||
State::Instance().activeFgInput == FGInput::DLSSG)
|
||||
UpdateTarget();
|
||||
|
||||
// Destroy if Swapchain has a change destroy FG Context too
|
||||
@@ -748,14 +750,16 @@ void FSRFG_Dx12::EvaluateState(ID3D12Device* device, FG_Constants& fgConstants)
|
||||
DestroyFGContext();
|
||||
}
|
||||
|
||||
if (State::Instance().activeFgInput == FGInput::Upscaler && _fgContext != nullptr && !IsPaused() && !IsActive())
|
||||
if ((State::Instance().activeFgInput == FGInput::Upscaler ||
|
||||
State::Instance().activeFgInput == FGInput::DLSSG) &&
|
||||
_fgContext != nullptr && !IsPaused() && !IsActive())
|
||||
Activate();
|
||||
}
|
||||
else if (IsActive())
|
||||
{
|
||||
Deactivate();
|
||||
|
||||
if (State::Instance().activeFgInput == FGInput::Upscaler)
|
||||
if (State::Instance().activeFgInput == FGInput::Upscaler || State::Instance().activeFgInput == FGInput::DLSSG)
|
||||
{
|
||||
State::Instance().ClearCapturedHudlesses = true;
|
||||
Hudfix_Dx12::ResetCounters();
|
||||
@@ -768,7 +772,7 @@ void FSRFG_Dx12::EvaluateState(ID3D12Device* device, FG_Constants& fgConstants)
|
||||
|
||||
State::Instance().FGchanged = false;
|
||||
|
||||
if (State::Instance().activeFgInput == FGInput::Upscaler)
|
||||
if (State::Instance().activeFgInput == FGInput::Upscaler || State::Instance().activeFgInput == FGInput::DLSSG)
|
||||
Hudfix_Dx12::ResetCounters();
|
||||
|
||||
// Pause for 10 frames
|
||||
|
||||
@@ -577,7 +577,8 @@ void XeFG_Dx12::EvaluateState(ID3D12Device* device, FG_Constants& fgConstants)
|
||||
CreateContext(device, fgConstants);
|
||||
|
||||
// Pause for 10 frames
|
||||
if (State::Instance().activeFgInput == FGInput::Upscaler)
|
||||
if (State::Instance().activeFgInput == FGInput::Upscaler ||
|
||||
State::Instance().activeFgInput == FGInput::DLSSG)
|
||||
UpdateTarget();
|
||||
}
|
||||
// If there is a change deactivate it
|
||||
@@ -586,7 +587,8 @@ void XeFG_Dx12::EvaluateState(ID3D12Device* device, FG_Constants& fgConstants)
|
||||
Deactivate();
|
||||
|
||||
// Pause for 10 frames
|
||||
if (State::Instance().activeFgInput == FGInput::Upscaler)
|
||||
if (State::Instance().activeFgInput == FGInput::Upscaler ||
|
||||
State::Instance().activeFgInput == FGInput::DLSSG)
|
||||
UpdateTarget();
|
||||
|
||||
// Destroy if Swapchain has a change destroy FG Context too
|
||||
@@ -594,14 +596,16 @@ void XeFG_Dx12::EvaluateState(ID3D12Device* device, FG_Constants& fgConstants)
|
||||
DestroyFGContext();
|
||||
}
|
||||
|
||||
if (State::Instance().activeFgInput == FGInput::Upscaler && _fgContext != nullptr && !IsPaused() && !IsActive())
|
||||
if ((State::Instance().activeFgInput == FGInput::Upscaler ||
|
||||
State::Instance().activeFgInput == FGInput::DLSSG) &&
|
||||
_fgContext != nullptr && !IsPaused() && !IsActive())
|
||||
Activate();
|
||||
}
|
||||
else
|
||||
{
|
||||
Deactivate();
|
||||
|
||||
if (State::Instance().activeFgInput == FGInput::Upscaler)
|
||||
if (State::Instance().activeFgInput == FGInput::Upscaler || State::Instance().activeFgInput == FGInput::DLSSG)
|
||||
{
|
||||
State::Instance().ClearCapturedHudlesses = true;
|
||||
Hudfix_Dx12::ResetCounters();
|
||||
@@ -614,7 +618,7 @@ void XeFG_Dx12::EvaluateState(ID3D12Device* device, FG_Constants& fgConstants)
|
||||
|
||||
State::Instance().FGchanged = false;
|
||||
|
||||
if (State::Instance().activeFgInput == FGInput::Upscaler)
|
||||
if (State::Instance().activeFgInput == FGInput::Upscaler || State::Instance().activeFgInput == FGInput::DLSSG)
|
||||
Hudfix_Dx12::ResetCounters();
|
||||
|
||||
// Pause for 10 frames
|
||||
|
||||
@@ -1814,7 +1814,7 @@ void ResTrack_Dx12::HookDevice(ID3D12Device* device)
|
||||
// Get the vtable pointer
|
||||
PVOID* pVTable = *(PVOID**) realDevice;
|
||||
|
||||
// hudless
|
||||
// Hudfix
|
||||
o_CreateDescriptorHeap = (PFN_CreateDescriptorHeap) pVTable[14];
|
||||
o_CreateConstantBufferView = (PFN_CreateConstantBufferView) pVTable[17];
|
||||
o_CreateShaderResourceView = (PFN_CreateShaderResourceView) pVTable[18];
|
||||
@@ -1826,6 +1826,7 @@ void ResTrack_Dx12::HookDevice(ID3D12Device* device)
|
||||
o_CopyDescriptorsSimple = (PFN_CopyDescriptorsSimple) pVTable[24];
|
||||
|
||||
// Apply the detour
|
||||
// Only needed for Hudfix
|
||||
if (o_CreateDescriptorHeap != nullptr && State::Instance().activeFgInput == FGInput::Upscaler)
|
||||
{
|
||||
DetourTransactionBegin();
|
||||
@@ -1859,7 +1860,7 @@ void ResTrack_Dx12::HookDevice(ID3D12Device* device)
|
||||
HookCommandList(device);
|
||||
}
|
||||
|
||||
// Only needed for hudfix
|
||||
// Only needed for Hudfix
|
||||
if (State::Instance().activeFgInput == FGInput::Upscaler)
|
||||
HookResource(device);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user