Add DefaultTextureSizeCapacity and MemoryScaleFactor
- Also remove redundant New Lines
This commit is contained in:
parent
cad45cfb56
commit
08d4bbaa91
2 changed files with 7 additions and 9 deletions
|
@ -47,6 +47,8 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||
{
|
||||
private const int MinCountForDeletion = 32;
|
||||
private const int MaxCapacity = 2048;
|
||||
private const ulong DefaultTextureSizeCapacity = 1024 * 1024 * 1024;
|
||||
private const float MemoryScaleFactor = 0.50f;
|
||||
|
||||
private readonly LinkedList<Texture> _textures;
|
||||
private ulong _totalSize;
|
||||
|
@ -63,16 +65,14 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||
/// </summary>
|
||||
private ulong GetMaxTextureCapacity()
|
||||
{
|
||||
Capabilities capabilities = _context.Capabilities;
|
||||
ulong maxMemory = _context.Capabilities.MaximumGpuMemory;
|
||||
|
||||
if (capabilities.MaximumGpuMemory <= 0)
|
||||
if (maxMemory > 0)
|
||||
{
|
||||
return 1024L * 1024 * 1024;
|
||||
}
|
||||
else
|
||||
{
|
||||
return (ulong)(capabilities.MaximumGpuMemory * 0.50);
|
||||
return (ulong)(maxMemory * MemoryScaleFactor);
|
||||
}
|
||||
|
||||
return DefaultTextureSizeCapacity;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -787,10 +787,8 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
|
||||
public ulong GetTotalGPUMemory()
|
||||
{
|
||||
|
||||
ulong totalMemory = 0;
|
||||
|
||||
|
||||
Api.GetPhysicalDeviceMemoryProperties(_physicalDevice.PhysicalDevice, out PhysicalDeviceMemoryProperties memoryProperties);
|
||||
|
||||
for (int i = 0; i < memoryProperties.MemoryHeapCount; i++)
|
||||
|
|
Loading…
Add table
Reference in a new issue