Merge pull request #7926 from stenzek/clear-tile-array

FramebufferManager: Only clear tile array when valid
This commit is contained in:
Connor McLaughlin 2019-03-24 16:57:18 +10:00 committed by GitHub
commit eaa1874875
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -407,15 +407,19 @@ void FramebufferManager::InvalidatePeekCache(bool forced)
{ {
if (forced || m_efb_color_cache.out_of_date) if (forced || m_efb_color_cache.out_of_date)
{ {
if (m_efb_color_cache.valid)
std::fill(m_efb_color_cache.tiles.begin(), m_efb_color_cache.tiles.end(), false);
m_efb_color_cache.valid = false; m_efb_color_cache.valid = false;
m_efb_color_cache.out_of_date = false; m_efb_color_cache.out_of_date = false;
std::fill(m_efb_color_cache.tiles.begin(), m_efb_color_cache.tiles.end(), false);
} }
if (forced || m_efb_depth_cache.out_of_date) if (forced || m_efb_depth_cache.out_of_date)
{ {
if (m_efb_depth_cache.valid)
std::fill(m_efb_depth_cache.tiles.begin(), m_efb_depth_cache.tiles.end(), false);
m_efb_depth_cache.valid = false; m_efb_depth_cache.valid = false;
m_efb_depth_cache.out_of_date = false; m_efb_depth_cache.out_of_date = false;
std::fill(m_efb_depth_cache.tiles.begin(), m_efb_depth_cache.tiles.end(), false);
} }
} }