diff options
author | bunnei <bunneidev@gmail.com> | 2018-08-10 01:13:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-10 01:13:27 +0200 |
commit | e58f7ff8439ac919d090aafae1c53b78231521c1 (patch) | |
tree | 4054818d5fa4096173b656aa8a2994c3a2ec0c22 /src/video_core | |
parent | Merge pull request #992 from bunnei/declr-pred (diff) | |
parent | gl_rasterizer_cache: Avoid iterator invalidation issues within InvalidateRegion() (diff) | |
download | yuzu-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 |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 6 |
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); } |