Merge pull request #999 from lioncash/map

gl_rasterizer_cache: Avoid iterator invalidation issues within InvalidateRegion()
master
bunnei 2018-08-09 19:13:27 +07:00 committed by GitHub
commit e58f7ff843
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

@ -761,10 +761,12 @@ void RasterizerCacheOpenGL::FlushRegion(Tegra::GPUVAddr /*addr*/, size_t /*size*
}
void RasterizerCacheOpenGL::InvalidateRegion(Tegra::GPUVAddr addr, size_t size) {
for (const auto& pair : surface_cache) {
const auto& surface{pair.second};
for (auto iter = surface_cache.cbegin(); iter != surface_cache.cend();) {
const auto& surface{iter->second};
const auto& params{surface->GetSurfaceParams()};
++iter;
if (params.IsOverlappingRegion(addr, size)) {
UnregisterSurface(surface);
}