more pag stuff (not active yet)

This commit is contained in:
cdozdil
2024-07-14 19:45:37 +03:00
parent a634e228f0
commit 4a2768c19b
5 changed files with 27 additions and 4 deletions
+2
View File
@@ -50,6 +50,7 @@ bool Config::Reload(std::filesystem::path iniPath)
FsrCameraFar = readFloat("FSR", "CameraFar");
FsrDebugView = readBool("FSR", "DebugView");
Fsr3xIndex = readInt("FSR", "UpscalerIndex");
FsrUsePAG = readBool("FSR", "UsePAG");
}
// XeSS
@@ -418,6 +419,7 @@ bool Config::SaveIni()
ini.SetValue("FSR", "CameraFar", GetFloatValue(Instance()->FsrCameraFar).c_str());
ini.SetValue("FSR", "DebugView", GetBoolValue(Instance()->FsrDebugView).c_str());
ini.SetValue("FSR", "UpscalerIndex", GetIntValue(Instance()->Fsr3xIndex).c_str());
ini.SetValue("FSR", "UsePAG", GetBoolValue(Instance()->FsrUsePAG).c_str());
}
// XeSS
+1
View File
@@ -125,6 +125,7 @@ public:
std::optional<float> FsrCameraFar;
std::optional<bool> FsrDebugView;
std::optional<int> Fsr3xIndex;
std::optional<bool> FsrUsePAG;
// dx11wdx12
std::optional<int> TextureSyncMethod;
+13 -2
View File
@@ -20,6 +20,7 @@ bool FSR2FeatureDx12::Init(ID3D12Device* InDevice, ID3D12GraphicsCommandList* In
OutputScaler = std::make_unique<BS_Dx12>("Output Downsample", InDevice, (TargetWidth() < DisplayWidth()));
RCAS = std::make_unique<RCAS_Dx12>("RCAS", InDevice);
//PAG = std::make_unique<PAG_Dx12>("PAG", InDevice);
return true;
}
@@ -238,8 +239,18 @@ bool FSR2FeatureDx12::Evaluate(ID3D12GraphicsCommandList* InCommandList, NVSDK_N
else
spdlog::debug("FSR2FeatureDx12::Evaluate AutoExposure enabled!");
bool pagOK = false;
//if (Config::Instance()->FsrUsePAG.value_or(false) && PAG != nullptr && PAG.get() != nullptr && PAG->IsInit() &&
// PAG->Dispatch(Device, InCommandList, paramColor, paramDepth, paramVelocity, { params.jitterOffset.x, params.jitterOffset.y }))
//{
// pagOK = true;
// params.reactive = ffxGetResourceDX12(&_context, PAG->ReactiveMask(), (wchar_t*)L"FSR2_Reactive", FFX_RESOURCE_STATE_COMPUTE_READ);
// params.motionVectors = ffxGetResourceDX12(&_context, PAG->MotionVector(), (wchar_t*)L"FSR2_MotionVectors", FFX_RESOURCE_STATE_COMPUTE_READ);
//}
ID3D12Resource* paramMask = nullptr;
if (!Config::Instance()->DisableReactiveMask.value_or(true))
if (!pagOK && !Config::Instance()->DisableReactiveMask.value_or(true))
{
if (InParameters->Get(NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_Mask, &paramMask) != NVSDK_NGX_Result_Success)
InParameters->Get(NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_Mask, (void**)&paramMask);
@@ -497,7 +508,7 @@ bool FSR2FeatureDx12::InitFSR2(const NVSDK_NGX_Parameter* InParameters)
bool EnableSharpening = featureFlags & NVSDK_NGX_DLSS_Feature_Flags_DoSharpening;
bool DepthInverted = featureFlags & NVSDK_NGX_DLSS_Feature_Flags_DepthInverted;
bool JitterMotion = featureFlags & NVSDK_NGX_DLSS_Feature_Flags_MVJittered;
bool LowRes = featureFlags & NVSDK_NGX_DLSS_Feature_Flags_MVLowRes;
bool LowRes = Config::Instance()->FsrUsePAG.value_or(false) || (featureFlags & NVSDK_NGX_DLSS_Feature_Flags_MVLowRes);
bool AutoExposure = featureFlags & NVSDK_NGX_DLSS_Feature_Flags_AutoExposure;
if (Config::Instance()->DepthInverted.value_or(DepthInverted))
@@ -1,6 +1,7 @@
#pragma once
#include "FSR2Feature.h"
#include "../IFeature_Dx12.h"
#include "../../pag/PAG_Dx12.h"
#include "../../fsr2/include/ffx_fsr2.h"
#include "../../fsr2/include/dx12/ffx_fsr2_dx12.h"
@@ -8,6 +9,7 @@
class FSR2FeatureDx12 : public FSR2Feature, public IFeature_Dx12
{
private:
//std::unique_ptr<PAG_Dx12> PAG = nullptr;
protected:
bool InitFSR2(const NVSDK_NGX_Parameter* InParameters);
+9 -2
View File
@@ -370,14 +370,14 @@ private:
// END - REINIT MENU
if (msg == WM_KEYDOWN && wParam == Config::Instance()->ResetKey.value_or(VK_END))
if ((msg == WM_KEYDOWN && wParam == Config::Instance()->ResetKey.value_or(VK_END)) || vmInputReset)
{
_isResetRequested = true;
return CallWindowProc(_oWndProc, hWnd, msg, wParam, lParam);
}
// INSERT - OPEN MENU
if (msg == WM_KEYDOWN && wParam == Config::Instance()->ShortcutKey.value_or(VK_INSERT))
if ((msg == WM_KEYDOWN && wParam == Config::Instance()->ShortcutKey.value_or(VK_INSERT)) || vmInputMenu)
{
_isVisible = !_isVisible;
@@ -1015,6 +1015,13 @@ public:
}
}
//if (bool enablePAG = Config::Instance()->FsrUsePAG.value_or(false); ImGui::Checkbox("Enable Potato Anti-Ghosting", &enablePAG))
//{
// Config::Instance()->FsrUsePAG = enablePAG;
// Config::Instance()->newBackend = currentBackend;
// Config::Instance()->changeBackend = true;
//}
bool useVFov = Config::Instance()->FsrVerticalFov.has_value() || !Config::Instance()->FsrHorizontalFov.has_value();
float vfov;