summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-08-10 01:13:27 +0200
committerGitHub <noreply@github.com>2018-08-10 01:13:27 +0200
commite58f7ff8439ac919d090aafae1c53b78231521c1 (patch)
tree4054818d5fa4096173b656aa8a2994c3a2ec0c22
parentMerge pull request #992 from bunnei/declr-pred (diff)
parentgl_rasterizer_cache: Avoid iterator invalidation issues within InvalidateRegion() (diff)
downloadyuzu-e58f7ff8439ac919d090aafae1c53b78231521c1.tar
yuzu-e58f7ff8439ac919d090aafae1c53b78231521c1.tar.gz
yuzu-e58f7ff8439ac919d090aafae1c53b78231521c1.tar.bz2
yuzu-e58f7ff8439ac919d090aafae1c53b78231521c1.tar.lz
yuzu-e58f7ff8439ac919d090aafae1c53b78231521c1.tar.xz
yuzu-e58f7ff8439ac919d090aafae1c53b78231521c1.tar.zst
yuzu-e58f7ff8439ac919d090aafae1c53b78231521c1.zip
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
index 8b6d1b89d..c447e999c 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
@@ -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);
}