Advertisement

DX11 SwapChain ResizeBuffers Crash? (For 2 days, 16 hours of looking, I couldn't figure it out)

Started by December 19, 2024 11:24 AM
2 comments, last by Juliean 2 days, 8 hours ago

Hello;
https://github.com/sametydev/SlateEngine/tree/main
My engine is available github i pushed all codes;
My problem is on DXFrameBuffer (SlateEngine/Engine/Graphics/Buffer/DXFrameBuffer),

I'm trying make a render texture and draw on editor, its working but on DXApplication::OnResize

App is crashing on this line (DXApplication::OnResize);


DXGI ERROR: IDXGISwapChain::ResizeBuffers: Swapchain cannot be resized unless all outstanding buffer references have been released. [ MISCELLANEOUS ERROR #19: ]

My DXFrameBuffer source code;
https://github.com/sametydev/SlateEngine/blob/main/SlateEngine/Engine/Graphics/Buffer/DXFrameBuffer.cpp

My call order (DXApplication.cpp : 90) | DXApplication::OnRun;

I know my engine's structre so bad, probably my pipeline order is wrong mb thats causes crash.
Normally I don't like to open a topic like this, I want to solve the error myself, but it doesn't work, I've worked for almost tens of hours, I've had a headache for 2 days and I still can't solve it xD

Thanks!

Actually i solved,

Its causes when i try store prev rtv and dtv.

Advertisement

In order for swap-chain resize to work, every reference to the current (back)buffer need to have been released. So, you can do what you were trying to do, but you need to make sure to release those references manually before doing the resize, via calling Release or freeing the CComPtr, or whatever it is you are using. It might be a bit unsafe just to capture random references returned by OMGetRenderTarget, unless you know that they are either always or never the backbuffer, and it's better to just store those references explicitely beforehand.

Advertisement