mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-10-11 06:22:12 +00:00
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:
1 parent
ee0dc449bb
commit
a676a402a0
1 file changed
+6
-4
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user