Skip to content

Acquire and release the D3D11 backbuffer in start/submit_frame

This was preventing mpv's D3D11 RA from resizing the swapchain externally in @jeeb's gpu_next patch, since all swapchain surfaces must be released before IDXGISwapChain::ResizeBuffers is called and libplacebo was always unnecessarily holding onto the surface. I couldn't notice any performance regression after brief testing, which makes sense since the ID3D11Texture2D probably still exists, just without external references.

I also noticed that calling resize after start_frame frees the out_frame->fbo that was returned by start_frame, making it an invalid pointer. It did that before, and it makes sense, but should we try to prevent this?

Merge request reports