maxMemory to CacheMemory, use Clamp instead of Ternary. Changed MinTextureCapacity 1GiB to 512 MiB
This commit is contained in:
parent
cfa3e8a7b5
commit
116f07cbb1
2 changed files with 7 additions and 7 deletions
|
@ -1,4 +1,4 @@
|
||||||
using Ryujinx.Common.Logging;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||||
{
|
{
|
||||||
private const int MinCountForDeletion = 32;
|
private const int MinCountForDeletion = 32;
|
||||||
private const int MaxCapacity = 2048;
|
private const int MaxCapacity = 2048;
|
||||||
private const ulong DefaultTextureSizeCapacity = 1UL * 1024 * 1024 * 1024;
|
private const ulong MinTextureSizeCapacity = 512 * 1024 * 1024;
|
||||||
private const ulong MaxTextureSizeCapacity = 4UL * 1024 * 1024 * 1024;
|
private const ulong MaxTextureSizeCapacity = 4UL * 1024 * 1024 * 1024;
|
||||||
private const float MemoryScaleFactor = 0.50f;
|
private const float MemoryScaleFactor = 0.50f;
|
||||||
private ulong _maxCacheMemoryUsage = 0;
|
private ulong _maxCacheMemoryUsage = 0;
|
||||||
|
@ -65,12 +65,9 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Initialize(GpuContext context)
|
public void Initialize(GpuContext context)
|
||||||
{
|
{
|
||||||
var maxMemory = (ulong)(context.Capabilities.MaximumGpuMemory * MemoryScaleFactor);
|
var CacheMemory = (ulong)(context.Capabilities.MaximumGpuMemory * MemoryScaleFactor);
|
||||||
|
|
||||||
_maxCacheMemoryUsage = maxMemory == 0 ?
|
_maxCacheMemoryUsage = Math.Clamp(CacheMemory, MinTextureSizeCapacity, MaxTextureSizeCapacity);
|
||||||
DefaultTextureSizeCapacity :
|
|
||||||
maxMemory > MaxTextureSizeCapacity ?
|
|
||||||
MaxTextureSizeCapacity : maxMemory;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -68,6 +68,9 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||||
_cache = new AutoDeleteCache();
|
_cache = new AutoDeleteCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes the cache, setting the maximum texture capacity for the specified GPU context.
|
||||||
|
/// </summary>
|
||||||
public void Initialize()
|
public void Initialize()
|
||||||
{
|
{
|
||||||
_cache.Initialize(_context);
|
_cache.Initialize(_context);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue