Magic numbers to constants
* changed 2 magic numbers to constants
This commit is contained in:
parent
36e8e074c9
commit
3db742a3f8
3 changed files with 21 additions and 5 deletions
|
@ -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<OGLStreamBuffer> Cache;
|
||||
|
||||
public OGLConstBuffer()
|
||||
{
|
||||
Cache = new OGLCachedResource<OGLStreamBuffer>(DeleteBuffer, MaxConstBufferCacheSize);
|
||||
Cache = new OGLCachedResource<OGLStreamBuffer>(DeleteBuffer, OGLResourceLimits.ConstBufferLimit);
|
||||
}
|
||||
|
||||
public void LockCache()
|
||||
|
|
18
Ryujinx.Graphics/Gal/OpenGL/OGLResourceLimits.cs
Normal file
18
Ryujinx.Graphics/Gal/OpenGL/OGLResourceLimits.cs
Normal file
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -6,7 +6,6 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
|||
{
|
||||
class OGLTexture : IGalTexture
|
||||
{
|
||||
private const long MaxTextureCacheSize = 768 * 1024 * 1024;
|
||||
|
||||
private OGLCachedResource<ImageHandler> TextureCache;
|
||||
|
||||
|
@ -14,7 +13,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
|||
|
||||
public OGLTexture()
|
||||
{
|
||||
TextureCache = new OGLCachedResource<ImageHandler>(DeleteTexture, MaxTextureCacheSize);
|
||||
TextureCache = new OGLCachedResource<ImageHandler>(DeleteTexture, OGLResourceLimits.TextureLimit);
|
||||
}
|
||||
|
||||
public void LockCache()
|
||||
|
|
Loading…
Add table
Reference in a new issue