From e3756ee7a77c5647e9f48d6c63e14b1c459b1ba1 Mon Sep 17 00:00:00 2001 From: MaxLastBreath Date: Tue, 24 Sep 2024 20:14:30 +0300 Subject: [PATCH] Increase TextureSize capacity for OpenGL back to 1024 - Added a new const ulong for OpenGLTextureSizeCapacity --- src/Ryujinx.Graphics.Gpu/Image/AutoDeleteCache.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Ryujinx.Graphics.Gpu/Image/AutoDeleteCache.cs b/src/Ryujinx.Graphics.Gpu/Image/AutoDeleteCache.cs index 1a75921b81..6effbd857a 100644 --- a/src/Ryujinx.Graphics.Gpu/Image/AutoDeleteCache.cs +++ b/src/Ryujinx.Graphics.Gpu/Image/AutoDeleteCache.cs @@ -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 /// /// Initializes the cache, setting the maximum texture capacity for the specified GPU context. /// + /// + /// For OpenGL this defaults to OpenGLTextureSizeCapacity. + /// /// The GPU context that the cache belongs to 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; + } } ///