rsx: Reset ZCULL statistics at the end of a frame

- Workaround for games that leak zpass/zstats.
  The information is useless anyway without a clear op so it should be fine.
This commit is contained in:
kd-11 2020-02-29 12:12:34 +03:00 committed by kd-11
parent 198c84cabf
commit eb140c52a4
1 changed files with 10 additions and 1 deletions

View File

@ -2560,6 +2560,15 @@ namespace rsx
Emu.Pause();
}
if (zcull_ctrl->has_pending())
{
// NOTE: This is a workaround for buggy games.
// Some applications leave the zpass/stats gathering active but don't use the information.
// This can lead to the zcull unit using up all the memory queueing up operations that never get consumed.
// Seen in Diablo III and Yakuza 5
zcull_ctrl->clear(this, CELL_GCM_ZPASS_PIXEL_CNT | CELL_GCM_ZCULL_STATS);
}
// Save current state
m_queued_flip.stats = m_frame_stats;
m_queued_flip.push(buffer);
@ -2930,7 +2939,7 @@ namespace rsx
void ZCULL_control::clear(class ::rsx::thread* ptimer, u32 type)
{
if (type != CELL_GCM_ZPASS_PIXEL_CNT)
if (!(type & CELL_GCM_ZPASS_PIXEL_CNT))
{
// Other types do not generate queries at the moment
return;