From 0a939cc6267c3197df79e6bb49ed7614aa9bb87f Mon Sep 17 00:00:00 2001 From: cdozdil Date: Wed, 15 May 2024 10:11:57 +0300 Subject: [PATCH] added check for sl.interposer + unreal engine games --- OptiScaler/imgui/imgui_overlay_dx12.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/OptiScaler/imgui/imgui_overlay_dx12.cpp b/OptiScaler/imgui/imgui_overlay_dx12.cpp index 08e12ac0..411f7a81 100644 --- a/OptiScaler/imgui/imgui_overlay_dx12.cpp +++ b/OptiScaler/imgui/imgui_overlay_dx12.cpp @@ -3,6 +3,7 @@ #include "../Util.h" #include "../Logger.h" +#include "../Config.h" #include @@ -73,7 +74,7 @@ static bool CreateDeviceD3D12(HWND InHWnd) PFN_D3D12_CREATE_DEVICE slCD = (PFN_D3D12_CREATE_DEVICE)DetourFindFunction("sl.interposer.dll", "D3D12CreateDevice"); - if (slCD != nullptr) + if (slCD != nullptr && Config::Instance()->NVNGX_Engine != NVSDK_NGX_ENGINE_TYPE_UNREAL) result = slCD(NULL, featureLevel, IID_PPV_ARGS(&g_pd3dDevice)); else result = D3D12CreateDevice(NULL, featureLevel, IID_PPV_ARGS(&g_pd3dDevice)); @@ -413,12 +414,12 @@ static void WINAPI hkExecuteCommandLists_Dx12(ID3D12CommandQueue* pCommandQueue, { g_pd3dCommandQueue = pCommandQueue; - DetourTransactionBegin(); - DetourUpdateThread(GetCurrentThread()); + //DetourTransactionBegin(); + //DetourUpdateThread(GetCurrentThread()); - DetourAttach(&(PVOID&)oExecuteCommandLists_Dx12, hkExecuteCommandLists_Dx12); + //DetourAttach(&(PVOID&)oExecuteCommandLists_Dx12, hkExecuteCommandLists_Dx12); - DetourTransactionCommit(); + //DetourTransactionCommit(); } return oExecuteCommandLists_Dx12(pCommandQueue, NumCommandLists, ppCommandLists);