Increase TextureSize capacity for OpenGL back to 1024

- Added a new const ulong for OpenGLTextureSizeCapacity
This commit is contained in:
MaxLastBreath 2024-09-24 20:14:30 +03:00
parent 527d169831
commit e3756ee7a7

View file

@ -1,3 +1,4 @@
using Ryujinx.Graphics.Shader.Translation;
using System;
using System.Collections;
using System.Collections.Generic;
@ -49,6 +50,7 @@ namespace Ryujinx.Graphics.Gpu.Image
private const int MaxCapacity = 2048;
private const ulong MinTextureSizeCapacity = 512 * 1024 * 1024;
private const ulong MaxTextureSizeCapacity = 4UL * 1024 * 1024 * 1024;
private const ulong OpenGLTextureSizeCapacity = 1UL * 1024 * 1024 * 1024;
private const float MemoryScaleFactor = 0.50f;
private ulong _maxCacheMemoryUsage = 0;
@ -63,12 +65,20 @@ namespace Ryujinx.Graphics.Gpu.Image
/// <summary>
/// Initializes the cache, setting the maximum texture capacity for the specified GPU context.
/// </summary>
/// <remarks>
/// For OpenGL this defaults to OpenGLTextureSizeCapacity.
/// </remarks>
/// <param name="context"> The GPU context that the cache belongs to</param>
public void Initialize(GpuContext context)
{
var CacheMemory = (ulong)(context.Capabilities.MaximumGpuMemory * MemoryScaleFactor);
_maxCacheMemoryUsage = Math.Clamp(CacheMemory, MinTextureSizeCapacity, MaxTextureSizeCapacity);
if (context.Capabilities.Api == TargetApi.OpenGL)
{
_maxCacheMemoryUsage = OpenGLTextureSizeCapacity;
}
}
/// <summary>