aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics/Gal/OpenGL/OGLConstBuffer.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/OGLConstBuffer.cs
parent453543fb882c2465b771b32baa204a1c085e0ea1 (diff)
Force cache to remove entries when memory usage exceeds a given threshold (#492)
Diffstat (limited to 'Ryujinx.Graphics/Gal/OpenGL/OGLConstBuffer.cs')
-rw-r--r--Ryujinx.Graphics/Gal/OpenGL/OGLConstBuffer.cs4
1 files changed, 3 insertions, 1 deletions
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<OGLStreamBuffer> Cache;
public OGLConstBuffer()
{
- Cache = new OGLCachedResource<OGLStreamBuffer>(DeleteBuffer);
+ Cache = new OGLCachedResource<OGLStreamBuffer>(DeleteBuffer, MaxConstBufferCacheSize);
}
public void LockCache()