GS/DX12: Misc Fixes.

Properly unbind slot 0 if previous draw was tex is fb or tex is ds.
Mirrors vk behavior.

Don't recycle draw_rt_clone in colclip, it's null at this point anyway.

Don't bind rt on slot 2 if we have multidraw fb copy enabled.
Mirrors barrier behavior on vk.
This commit is contained in:
lightningterror 2025-11-18 18:35:41 +01:00
parent c2488c9269
commit 9aabb197e6

View File

@ -3940,9 +3940,6 @@ void GSDevice12::RenderHW(GSHWDrawConfig& config)
{
Console.Warning("D3D12: Failed to allocate ColorClip render target, aborting draw.");
if (draw_rt_clone)
Recycle(draw_rt_clone);
if (date_image)
Recycle(date_image);
@ -3964,15 +3961,16 @@ void GSDevice12::RenderHW(GSHWDrawConfig& config)
}
// we're not drawing to the RT, so we can use it as a source
if (config.require_one_barrier)
if (config.require_one_barrier && !m_features.multidraw_fb_copy)
PSSetShaderResource(2, draw_rt, true);
}
draw_rt = colclip_rt;
}
// Clear texture binding when it's bound to RT, DSV will be read only.
if (draw_rt && static_cast<GSTexture12*>(draw_rt)->GetSRVDescriptor() == m_tfx_textures[0])
// Clear texture binding when it's bound to RT or DS.
if (!config.tex && ((draw_rt && static_cast<GSTexture12*>(draw_rt)->GetSRVDescriptor() == m_tfx_textures[0]) ||
(draw_ds && static_cast<GSTexture12*>(draw_ds)->GetSRVDescriptor() == m_tfx_textures[0])))
PSSetShaderResource(0, nullptr, false);
if (m_in_render_pass && (m_current_render_target == draw_rt || m_current_depth_target == draw_ds))