GS/GL: Expand the fb optimization hit detection.

This commit is contained in:
lightningterror
2026-06-12 22:29:47 +02:00
parent 2b5d3510c3
commit 16592f3a6e
+4 -6
View File
@@ -2974,17 +2974,15 @@ void GSDeviceOGL::RenderHW(GSHWDrawConfig& config)
// Avoid changing framebuffer just to switch from rt+depth to rt and vice versa.
bool fb_optimization_needs_barrier = false;
if (!draw_rt && GLState::rt && GLState::ds == draw_ds && config.tex != GLState::rt &&
draw_ds && GLState::rt->GetSize() == draw_ds->GetSize() && !draw_ds_as_rt)
if (!(draw_rt || draw_ds_as_rt) && draw_ds && GLState::rt && GLState::rt->GetSize() == draw_ds->GetSize())
{
draw_rt = GLState::rt;
fb_optimization_needs_barrier = !GLState::rt_written;
fb_optimization_needs_barrier = !GLState::rt_written && GLState::ds == draw_ds;
}
else if (!draw_ds && GLState::ds && GLState::rt == draw_rt && config.tex != GLState::ds &&
draw_rt && GLState::ds->GetSize() == draw_rt->GetSize() && !draw_ds_as_rt)
else if (!(draw_ds || draw_ds_as_rt) && draw_rt && GLState::ds && GLState::ds->GetSize() == draw_rt->GetSize())
{
draw_ds = GLState::ds;
fb_optimization_needs_barrier = !GLState::ds_written;
fb_optimization_needs_barrier = !GLState::ds_written && GLState::rt == draw_rt;
}
// Be careful of the rt already being bound and the blend using the RT without a barrier.