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/OGLConstBuffer.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Ryujinx.Graphics/Gal/OpenGL/OGLConstBuffer.cs') diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLConstBuffer.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLConstBuffer.cs index 4958b53b..e04190e0 100644 --- a/Ryujinx.Graphics/Gal/OpenGL/OGLConstBuffer.cs +++ b/Ryujinx.Graphics/Gal/OpenGL/OGLConstBuffer.cs @@ -5,11 +5,13 @@ namespace Ryujinx.Graphics.Gal.OpenGL { class OGLConstBuffer : IGalConstBuffer { + private const long MaxConstBufferCacheSize = 64 * 1024 * 1024; + private OGLCachedResource Cache; public OGLConstBuffer() { - Cache = new OGLCachedResource(DeleteBuffer); + Cache = new OGLCachedResource(DeleteBuffer, MaxConstBufferCacheSize); } public void LockCache() -- cgit v1.2.3