From 5045abc4bc4fec0db82b34e36fbfc729a745b383 Mon Sep 17 00:00:00 2001 From: cdozdil Date: Wed, 22 Jan 2025 00:20:22 +0300 Subject: [PATCH] fixed mixing of ffx_dx12 and ffx_vk --- OptiScaler/FfxApi_Dx12.cpp | 3 +++ OptiScaler/FfxApi_Dx12.h | 2 -- OptiScaler/FfxApi_Proxy.h | 4 +--- OptiScaler/backends/fsr31/FSR31Feature.h | 4 ++-- OptiScaler/backends/fsr31/FSR31Feature_Dx11On12.cpp | 2 ++ OptiScaler/backends/fsr31/FSR31Feature_Dx12.cpp | 2 ++ OptiScaler/backends/fsr31/FSR31Feature_Vk.cpp | 1 + 7 files changed, 11 insertions(+), 7 deletions(-) diff --git a/OptiScaler/FfxApi_Dx12.cpp b/OptiScaler/FfxApi_Dx12.cpp index 57f08c40..6cc52f5c 100644 --- a/OptiScaler/FfxApi_Dx12.cpp +++ b/OptiScaler/FfxApi_Dx12.cpp @@ -6,6 +6,9 @@ #include "FfxApi_Proxy.h" #include "NVNGX_Parameter.h" +#include "ffx_upscale.h" +#include "dx12/ffx_api_dx12.h" + static std::map _initParams; static std::map _nvParams; static std::map _contexts; diff --git a/OptiScaler/FfxApi_Dx12.h b/OptiScaler/FfxApi_Dx12.h index a3df0a8e..0c0d4abc 100644 --- a/OptiScaler/FfxApi_Dx12.h +++ b/OptiScaler/FfxApi_Dx12.h @@ -1,8 +1,6 @@ #pragma once #include "ffx_api.h" -#include "ffx_upscale.h" -#include "dx12/ffx_api_dx12.h" ffxReturnCode_t ffxCreateContext_Dx12(ffxContext* context, ffxCreateContextDescHeader* desc, const ffxAllocationCallbacks* memCb); ffxReturnCode_t ffxDestroyContext_Dx12(ffxContext* context, const ffxAllocationCallbacks* memCb); diff --git a/OptiScaler/FfxApi_Proxy.h b/OptiScaler/FfxApi_Proxy.h index 8d08ce01..6377b637 100644 --- a/OptiScaler/FfxApi_Proxy.h +++ b/OptiScaler/FfxApi_Proxy.h @@ -46,7 +46,6 @@ public: spdlog::info(""); State::Instance().upscalerDisableHook = true; - //Config::Instance()->dxgiSkipSpoofing = true; LOG_DEBUG("Loading amd_fidelityfx_dx12.dll methods"); @@ -74,7 +73,7 @@ public: _D3D12_Query = (PfnFfxQuery)DetourFindFunction("amd_fidelityfx_dx12.dll", "ffxQuery"); } - if (/*Config::Instance()->FfxInputs.value_or_default() && */_D3D12_CreateContext != nullptr) + if (_D3D12_CreateContext != nullptr) { DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); @@ -171,7 +170,6 @@ public: spdlog::info(""); State::Instance().upscalerDisableHook = true; - //Config::Instance()->dxgiSkipSpoofing = true; LOG_DEBUG("Loading amd_fidelityfx_vk.dll methods"); diff --git a/OptiScaler/backends/fsr31/FSR31Feature.h b/OptiScaler/backends/fsr31/FSR31Feature.h index aeb8bcce..cbec3aaf 100644 --- a/OptiScaler/backends/fsr31/FSR31Feature.h +++ b/OptiScaler/backends/fsr31/FSR31Feature.h @@ -1,9 +1,9 @@ #pragma once -#include "../../FfxApi_Proxy.h" + #include "ffx_upscale.h" #include "../IFeature.h" -#include "../../detours/detours.h" +//#include "../../detours/detours.h" inline static void FfxLogCallback(uint32_t type, const wchar_t* message) { diff --git a/OptiScaler/backends/fsr31/FSR31Feature_Dx11On12.cpp b/OptiScaler/backends/fsr31/FSR31Feature_Dx11On12.cpp index 97b772c2..2a77d6b0 100644 --- a/OptiScaler/backends/fsr31/FSR31Feature_Dx11On12.cpp +++ b/OptiScaler/backends/fsr31/FSR31Feature_Dx11On12.cpp @@ -2,6 +2,8 @@ #include "../../Config.h" #include "../../Util.h" +#include "../../FfxApi_Proxy.h" + #include "FSR31Feature_Dx11On12.h" FSR31FeatureDx11on12::FSR31FeatureDx11on12(unsigned int InHandleId, NVSDK_NGX_Parameter* InParameters) : FSR31Feature(InHandleId, InParameters), IFeature_Dx11wDx12(InHandleId, InParameters), IFeature_Dx11(InHandleId, InParameters), IFeature(InHandleId, InParameters) diff --git a/OptiScaler/backends/fsr31/FSR31Feature_Dx12.cpp b/OptiScaler/backends/fsr31/FSR31Feature_Dx12.cpp index bee36baa..863dfcc5 100644 --- a/OptiScaler/backends/fsr31/FSR31Feature_Dx12.cpp +++ b/OptiScaler/backends/fsr31/FSR31Feature_Dx12.cpp @@ -2,6 +2,8 @@ #include "../../Config.h" #include "../../Util.h" +#include "../../FfxApi_Proxy.h" + #include "FSR31Feature_Dx12.h" FSR31FeatureDx12::FSR31FeatureDx12(unsigned int InHandleId, NVSDK_NGX_Parameter* InParameters) : FSR31Feature(InHandleId, InParameters), IFeature_Dx12(InHandleId, InParameters), IFeature(InHandleId, InParameters) diff --git a/OptiScaler/backends/fsr31/FSR31Feature_Vk.cpp b/OptiScaler/backends/fsr31/FSR31Feature_Vk.cpp index 575845cb..e52b41f2 100644 --- a/OptiScaler/backends/fsr31/FSR31Feature_Vk.cpp +++ b/OptiScaler/backends/fsr31/FSR31Feature_Vk.cpp @@ -2,6 +2,7 @@ #include "../../Config.h" #include "../../Util.h" +#include "../../FfxApi_Proxy.h" #include "FSR31Feature_Vk.h" #include "nvsdk_ngx_vk.h"