aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2018-11-14 20:22:02 -0200
committerAc_K <Acoustik666@gmail.com>2018-11-14 23:22:02 +0100
commit85ffd760161c6995f0004e042178d2e9259b2af5 (patch)
tree5b9b1a1149b0a296b7232708ae6b9f0b267d3d53 /Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs
parent453543fb882c2465b771b32baa204a1c085e0ea1 (diff)
Force cache to remove entries when memory usage exceeds a given threshold (#492)
Diffstat (limited to 'Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs')
-rw-r--r--Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs7
1 files changed, 5 insertions, 2 deletions
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<int> VboCache;
@@ -24,8 +27,8 @@ namespace Ryujinx.Graphics.Gal.OpenGL
{
VertexBuffers = new int[32];
- VboCache = new OGLCachedResource<int>(GL.DeleteBuffer);
- IboCache = new OGLCachedResource<int>(GL.DeleteBuffer);
+ VboCache = new OGLCachedResource<int>(GL.DeleteBuffer, MaxVertexBufferCacheSize);
+ IboCache = new OGLCachedResource<int>(GL.DeleteBuffer, MaxIndexBufferCacheSize);
IndexBuffer = new IbInfo();
}