From 4449331843df3d4fc71577fce515b548fd44e67f Mon Sep 17 00:00:00 2001 From: cdozdil Date: Mon, 18 May 2026 15:53:19 +0300 Subject: [PATCH] Disable release of swapchain backbuffers for WrappedIDXGISwapChain4 --- OptiScaler/wrapped/wrapped_swapchain.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/OptiScaler/wrapped/wrapped_swapchain.cpp b/OptiScaler/wrapped/wrapped_swapchain.cpp index 961a580d..eb180a3e 100644 --- a/OptiScaler/wrapped/wrapped_swapchain.cpp +++ b/OptiScaler/wrapped/wrapped_swapchain.cpp @@ -743,10 +743,12 @@ HRESULT STDMETHODCALLTYPE WrappedIDXGISwapChain4::ResizeBuffers(UINT BufferCount WaitForGPUIdle(_device); + // Release swapchain backbuffers to prevent errors when resizing + /* + const bool outputRequiresRelease = State::Instance().activeFgOutput == FGOutput::FSRFG || State::Instance().activeFgOutput == FGOutput::XeFG; - // Release swapchain backbuffers to prevent errors when resizing if (outputRequiresRelease && State::Instance().currentFG != nullptr) { IDXGISwapChain* skSC = nullptr; @@ -790,6 +792,7 @@ HRESULT STDMETHODCALLTYPE WrappedIDXGISwapChain4::ResizeBuffers(UINT BufferCount std::this_thread::sleep_for(std::chrono::milliseconds(100)); } + */ #ifdef DXGI_DEBUG_ENABLED ReportDXGILiveObjects(); @@ -1119,10 +1122,11 @@ HRESULT STDMETHODCALLTYPE WrappedIDXGISwapChain4::ResizeBuffers1(UINT BufferCoun WaitForGPUIdle(_device); + // Release swapchain backbuffers to prevent errors when resizing + /* const bool outputRequiresRelease = State::Instance().activeFgOutput == FGOutput::FSRFG || State::Instance().activeFgOutput == FGOutput::XeFG; - // Release swapchain backbuffers to prevent errors when resizing if (outputRequiresRelease && State::Instance().currentFG != nullptr) { IDXGISwapChain* skSC = nullptr; @@ -1188,6 +1192,7 @@ HRESULT STDMETHODCALLTYPE WrappedIDXGISwapChain4::ResizeBuffers1(UINT BufferCoun std::this_thread::sleep_for(std::chrono::milliseconds(100)); } + */ #ifdef DXGI_DEBUG_ENABLED ReportDXGILiveObjects();