From a676a402a0cba255162dd673591a8ea760c473cc Mon Sep 17 00:00:00 2001 From: kebas Date: Sun, 27 Sep 2026 12:58:24 +0300 Subject: [PATCH] Don't treat 0x0 swapchains as overlay calls Width/Height 0 in the swapchain desc means DXGI uses the window size, so these are real game swapchains and should be wrapped. --- OptiScaler/hooks/DxgiFactory_Hooks.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/OptiScaler/hooks/DxgiFactory_Hooks.cpp b/OptiScaler/hooks/DxgiFactory_Hooks.cpp index a27811f0..1227c708 100644 --- a/OptiScaler/hooks/DxgiFactory_Hooks.cpp +++ b/OptiScaler/hooks/DxgiFactory_Hooks.cpp @@ -427,7 +427,8 @@ HRESULT DxgiFactoryHooks::CreateSwapChain(IDXGIFactory* realFactory, IUnknown* p return res; } - if (pDesc->BufferDesc.Height < 100 || pDesc->BufferDesc.Width < 100) + if ((pDesc->BufferDesc.Height != 0 && pDesc->BufferDesc.Height < 100) || + (pDesc->BufferDesc.Width != 0 && pDesc->BufferDesc.Width < 100)) { LOG_WARN("Overlay call!"); @@ -796,7 +797,7 @@ HRESULT DxgiFactoryHooks::CreateSwapChainForHwnd(IDXGIFactory2* realFactory, IUn return result; } - if (pDesc->Height < 100 || pDesc->Width < 100) + if ((pDesc->Height != 0 && pDesc->Height < 100) || (pDesc->Width != 0 && pDesc->Width < 100)) { LOG_WARN("Overlay call!"); HRESULT result; @@ -1302,7 +1303,8 @@ HRESULT DxgiFactoryHooks::DLSSGCreateSwapChain(IDXGIFactory* realFactory, IUnkno return res; } - if (pDesc->BufferDesc.Height < 100 || pDesc->BufferDesc.Width < 100) + if ((pDesc->BufferDesc.Height != 0 && pDesc->BufferDesc.Height < 100) || + (pDesc->BufferDesc.Width != 0 && pDesc->BufferDesc.Width < 100)) { LOG_WARN("Overlay call!"); @@ -1596,7 +1598,7 @@ HRESULT DxgiFactoryHooks::DLSSGCreateSwapChainForHwnd(IDXGIFactory2* realFactory return result; } - if (pDesc->Height < 100 || pDesc->Width < 100) + if ((pDesc->Height != 0 && pDesc->Height < 100) || (pDesc->Width != 0 && pDesc->Width < 100)) { LOG_WARN("Overlay call!"); HRESULT result;