From 0dc05598bdbcf152e2aa272cbe9730c69fc3be55 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Mon, 19 Oct 2026 02:39:48 +1000 Subject: [PATCH] D3D12Device: Unbind all render targets when one is destroyed Clearing just the destroyed slot left a null entry that the next render pass dereferenced. Matches Vulkan. --- src/util/d3d12_device.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/util/d3d12_device.cpp b/src/util/d3d12_device.cpp index 55c94cd80..906aca755 100644 --- a/src/util/d3d12_device.cpp +++ b/src/util/d3d12_device.cpp @@ -2156,9 +2156,8 @@ void D3D12Device::UnbindTexture(D3D12Texture* tex) { if (m_current_render_targets[i] == tex) { - if (InRenderPass()) - EndRenderPass(); - m_current_render_targets[i] = nullptr; + SetRenderTargets(nullptr, 0, m_current_depth_target); + break; } } }