diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLConstBuffer.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLConstBuffer.cs index a12681c7ce..6fd8776b08 100644 --- a/Ryujinx.Graphics/Gal/OpenGL/OGLConstBuffer.cs +++ b/Ryujinx.Graphics/Gal/OpenGL/OGLConstBuffer.cs @@ -1,17 +1,16 @@ -using OpenTK.Graphics.OpenGL; +using OpenTK.Graphics.OpenGL; using System; namespace Ryujinx.Graphics.Gal.OpenGL { class OGLConstBuffer : IGalConstBuffer { - private const long MaxConstBufferCacheSize = 64 * 1024 * 1024; private OGLCachedResource Cache; public OGLConstBuffer() { - Cache = new OGLCachedResource(DeleteBuffer, MaxConstBufferCacheSize); + Cache = new OGLCachedResource(DeleteBuffer, OGLResourceLimits.ConstBufferLimit); } public void LockCache() diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLResourceLimits.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLResourceLimits.cs new file mode 100644 index 0000000000..0a39ec58f8 --- /dev/null +++ b/Ryujinx.Graphics/Gal/OpenGL/OGLResourceLimits.cs @@ -0,0 +1,18 @@ +namespace Ryujinx.Graphics.Gal.OpenGL +{ + static class OGLResourceLimits + { + private const int KB = 1024; + private const int MB = 1024 * KB; + + public const int ConstBufferLimit = 64 * MB; + + public const int VertexArrayLimit = 16384; + public const int VertexBufferLimit = 128 * MB; + public const int IndexBufferLimit = 64 * MB; + + public const int TextureLimit = 768 * MB; + + public const int PixelBufferLimit = 64 * MB; + } +} \ No newline at end of file diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLTexture.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLTexture.cs index ef984b1ed3..652d0ceefb 100644 --- a/Ryujinx.Graphics/Gal/OpenGL/OGLTexture.cs +++ b/Ryujinx.Graphics/Gal/OpenGL/OGLTexture.cs @@ -6,7 +6,6 @@ namespace Ryujinx.Graphics.Gal.OpenGL { class OGLTexture : IGalTexture { - private const long MaxTextureCacheSize = 768 * 1024 * 1024; private OGLCachedResource TextureCache; @@ -14,7 +13,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL public OGLTexture() { - TextureCache = new OGLCachedResource(DeleteTexture, MaxTextureCacheSize); + TextureCache = new OGLCachedResource(DeleteTexture, OGLResourceLimits.TextureLimit); } public void LockCache()