rsx: Conditionally skip flush if no new data was introduced

This commit is contained in:
kd-11 2022-12-15 15:40:33 +03:00 committed by kd-11
parent a05e3f02b8
commit 66dc1cc15d

View File

@ -1645,12 +1645,18 @@ namespace rsx
ensure(exists()); ensure(exists());
AUDIT(is_locked()); AUDIT(is_locked());
// If we are fully inside the flush exclusions regions, we just mark ourselves as flushed and return auto cleanup_flush = [&]()
if (get_confirmed_range().inside(flush_exclusions))
{ {
flushed = true; flushed = true;
flush_exclusions.clear(); flush_exclusions.clear();
on_flush(); on_flush();
};
// If we are fully inside the flush exclusions regions, we just mark ourselves as flushed and return
// We apply the same skip if there is nothing new in the surface data
if (!should_flush() || get_confirmed_range().inside(flush_exclusions))
{
cleanup_flush();
return; return;
} }
@ -1662,10 +1668,8 @@ namespace rsx
// Finish up // Finish up
// Its highly likely that this surface will be reused, so we just leave resources in place // Its highly likely that this surface will be reused, so we just leave resources in place
flushed = true;
derived()->finish_flush(); derived()->finish_flush();
flush_exclusions.clear(); cleanup_flush();
on_flush();
} }
void add_flush_exclusion(const address_range& rng) void add_flush_exclusion(const address_range& rng)