gl_rasterizer_cache: Remove all fully invalid surfaces from the cache
Some games (e.g. Pilotwings Resort) create many surfaces that are invalidated quickly but were never removed. This occasionally lead to large lag spikes due to high lookup times and other data structure management overhead.
This commit is contained in:
parent
8df502a688
commit
935e88a580
@ -1858,9 +1858,9 @@ void RasterizerCacheOpenGL::InvalidateRegion(PAddr addr, u32 size, const Surface
|
|||||||
cached_surface->invalid_regions.insert(interval);
|
cached_surface->invalid_regions.insert(interval);
|
||||||
cached_surface->InvalidateAllWatcher();
|
cached_surface->InvalidateAllWatcher();
|
||||||
|
|
||||||
// Remove only "empty" fill surfaces to avoid destroying and recreating OGL textures
|
// If the surface has no salvageable data it should be removed from the cache to avoid
|
||||||
if (cached_surface->type == SurfaceType::Fill &&
|
// clogging the data structure
|
||||||
cached_surface->IsSurfaceFullyInvalid()) {
|
if (cached_surface->IsSurfaceFullyInvalid()) {
|
||||||
remove_surfaces.emplace(cached_surface);
|
remove_surfaces.emplace(cached_surface);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user