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.
This commit is contained in:
kebas authored and Michał Lewandowski committed 2026-10-08 11:09:13 +02:00
1 parent ee0dc449bb
commit a676a402a0
1 file changed
+6 -4
+6 -4
View File
@@ -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;