diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2018-11-14 20:22:02 -0200 |
|---|---|---|
| committer | Ac_K <Acoustik666@gmail.com> | 2018-11-14 23:22:02 +0100 |
| commit | 85ffd760161c6995f0004e042178d2e9259b2af5 (patch) | |
| tree | 5b9b1a1149b0a296b7232708ae6b9f0b267d3d53 /Ryujinx.Graphics/Gal/OpenGL/OGLTexture.cs | |
| parent | 453543fb882c2465b771b32baa204a1c085e0ea1 (diff) | |
Force cache to remove entries when memory usage exceeds a given threshold (#492)
Diffstat (limited to 'Ryujinx.Graphics/Gal/OpenGL/OGLTexture.cs')
| -rw-r--r-- | Ryujinx.Graphics/Gal/OpenGL/OGLTexture.cs | 4 |
1 files changed, 3 insertions, 1 deletions
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<ImageHandler> TextureCache; public EventHandler<int> TextureDeleted { get; set; } public OGLTexture() { - TextureCache = new OGLCachedResource<ImageHandler>(DeleteTexture); + TextureCache = new OGLCachedResource<ImageHandler>(DeleteTexture, MaxTextureCacheSize); } public void LockCache() |
