Use Upscaler input logic for DLSSGFG inputs

This commit is contained in:
cdozdil
2025-08-21 00:31:48 +03:00
parent 95588d2659
commit 53be488f4d
3 changed files with 21 additions and 12 deletions
+9 -5
View File
@@ -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
+9 -5
View File
@@ -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);
}