Force cache to remove entries when memory usage exceeds a given threshold (#492)

This commit is contained in:
gdkchan 2018-11-14 20:22:02 -02:00 committed by Ac_K
parent 453543fb88
commit 85ffd76016
4 changed files with 30 additions and 7 deletions

View file

@ -6,13 +6,15 @@ namespace Ryujinx.Graphics.Gal.OpenGL
{
class OGLTexture : IGalTexture
{
private const long MaxTextureCacheSize = 768 * 1024 * 1024;
private OGLCachedResource<ImageHandler> TextureCache;
public EventHandler<int> TextureDeleted { get; set; }
public OGLTexture()
{
TextureCache = new OGLCachedResource<ImageHandler>(DeleteTexture);
TextureCache = new OGLCachedResource<ImageHandler>(DeleteTexture, MaxTextureCacheSize);
}
public void LockCache()