mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-11-07 22:42:45 +00:00
Ensure that ALLOW_TEARING is applied on swapchain resize with DLSSG
Slopped. FIxes a crash in BeamNG with DLSSG Dx12 output on resize
This commit is contained in:
1 parent
18d4d2e483
commit
b48fcb0dc3
1 file changed
+14
@@ -661,6 +661,13 @@ HRESULT FGHooks::hkResizeBuffers(IDXGISwapChain* This, UINT BufferCount, UINT Wi
|
||||
}
|
||||
}
|
||||
|
||||
// DLSSG creates its swapchain with ALLOW_TEARING and DXGI rejects resizes that add or remove it
|
||||
if (State::Instance().activeFgOutput == FGOutput::DLSSG && !(SwapChainFlags & DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING))
|
||||
{
|
||||
LOG_DEBUG("Keeping DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING for DLSSG");
|
||||
SwapChainFlags |= DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING;
|
||||
}
|
||||
|
||||
LOG_DEBUG("BufferCount: {}, Width: {}, Height: {}, NewFormat:{}, SwapChainFlags: {:X}", BufferCount, Width, Height,
|
||||
(UINT) NewFormat, SwapChainFlags);
|
||||
|
||||
@@ -902,6 +909,13 @@ HRESULT FGHooks::hkResizeBuffers1(IDXGISwapChain3* This, UINT BufferCount, UINT
|
||||
}
|
||||
}
|
||||
|
||||
// DLSSG creates its swapchain with ALLOW_TEARING and DXGI rejects resizes that add or remove it
|
||||
if (State::Instance().activeFgOutput == FGOutput::DLSSG && !(SwapChainFlags & DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING))
|
||||
{
|
||||
LOG_DEBUG("Keeping DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING for DLSSG");
|
||||
SwapChainFlags |= DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING;
|
||||
}
|
||||
|
||||
LOG_DEBUG("BufferCount: {}, Width: {}, Height: {}, NewFormat:{}, SwapChainFlags: {:X}, Caller: {}", BufferCount,
|
||||
Width, Height, (UINT) Format, SwapChainFlags, Util::WhoIsTheCaller(_ReturnAddress()));
|
||||
|
||||
|
||||
Reference in new issue
Block a user