From 85ffd760161c6995f0004e042178d2e9259b2af5 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Wed, 14 Nov 2018 20:22:02 -0200 Subject: Force cache to remove entries when memory usage exceeds a given threshold (#492) --- Ryujinx.Graphics/Gal/OpenGL/OGLTexture.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Ryujinx.Graphics/Gal/OpenGL/OGLTexture.cs') diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLTexture.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLTexture.cs index 274b94ea..6f843b9c 100644 --- a/Ryujinx.Graphics/Gal/OpenGL/OGLTexture.cs +++ b/Ryujinx.Graphics/Gal/OpenGL/OGLTexture.cs @@ -6,13 +6,15 @@ namespace Ryujinx.Graphics.Gal.OpenGL { class OGLTexture : IGalTexture { + private const long MaxTextureCacheSize = 768 * 1024 * 1024; + private OGLCachedResource TextureCache; public EventHandler TextureDeleted { get; set; } public OGLTexture() { - TextureCache = new OGLCachedResource(DeleteTexture); + TextureCache = new OGLCachedResource(DeleteTexture, MaxTextureCacheSize); } public void LockCache() -- cgit v1.2.3