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/OGLRasterizer.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs') diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs index cefbb2d2..cd6292f7 100644 --- a/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs +++ b/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs @@ -5,6 +5,9 @@ namespace Ryujinx.Graphics.Gal.OpenGL { class OGLRasterizer : IGalRasterizer { + private const long MaxVertexBufferCacheSize = 128 * 1024 * 1024; + private const long MaxIndexBufferCacheSize = 64 * 1024 * 1024; + private int[] VertexBuffers; private OGLCachedResource VboCache; @@ -24,8 +27,8 @@ namespace Ryujinx.Graphics.Gal.OpenGL { VertexBuffers = new int[32]; - VboCache = new OGLCachedResource(GL.DeleteBuffer); - IboCache = new OGLCachedResource(GL.DeleteBuffer); + VboCache = new OGLCachedResource(GL.DeleteBuffer, MaxVertexBufferCacheSize); + IboCache = new OGLCachedResource(GL.DeleteBuffer, MaxIndexBufferCacheSize); IndexBuffer = new IbInfo(); } -- cgit v1.2.3