Merge pull request #999 from lioncash/map
gl_rasterizer_cache: Avoid iterator invalidation issues within InvalidateRegion()
This commit is contained in:
commit
e58f7ff843
|
@ -761,10 +761,12 @@ void RasterizerCacheOpenGL::FlushRegion(Tegra::GPUVAddr /*addr*/, size_t /*size*
|
||||||
}
|
}
|
||||||
|
|
||||||
void RasterizerCacheOpenGL::InvalidateRegion(Tegra::GPUVAddr addr, size_t size) {
|
void RasterizerCacheOpenGL::InvalidateRegion(Tegra::GPUVAddr addr, size_t size) {
|
||||||
for (const auto& pair : surface_cache) {
|
for (auto iter = surface_cache.cbegin(); iter != surface_cache.cend();) {
|
||||||
const auto& surface{pair.second};
|
const auto& surface{iter->second};
|
||||||
const auto& params{surface->GetSurfaceParams()};
|
const auto& params{surface->GetSurfaceParams()};
|
||||||
|
|
||||||
|
++iter;
|
||||||
|
|
||||||
if (params.IsOverlappingRegion(addr, size)) {
|
if (params.IsOverlappingRegion(addr, size)) {
|
||||||
UnregisterSurface(surface);
|
UnregisterSurface(surface);
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue