mirror of
https://git.ryujinx.app/kenji-nx/ryujinx.git
synced 2025-12-19 13:37:04 +00:00
Memory changes 2.2
A few more internal changes to the RangeList systems. * No longer using a QuickAccess dictionary. * The performance of the dictionary wasn't much faster than just doing binary searches. * Using just binary searches allows us to take advantage of span and array returns as they're are faster than linked lists when iterating or copying the overlaps. Small code optimizations. Fixes a few leftover crashes.
This commit is contained in:
parent
c2f54d0a5c
commit
dae7ae7eaf
14 changed files with 242 additions and 239 deletions
|
|
@ -110,7 +110,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
|
|||
ulong size,
|
||||
BufferStage stage,
|
||||
bool sparseCompatible,
|
||||
List<Buffer> baseBuffers)
|
||||
RangeItem<Buffer>[] baseBuffers)
|
||||
{
|
||||
_context = context;
|
||||
_physicalMemory = physicalMemory;
|
||||
|
|
@ -128,18 +128,18 @@ namespace Ryujinx.Graphics.Gpu.Memory
|
|||
|
||||
List<IRegionHandle> baseHandles = null;
|
||||
|
||||
if (baseBuffers.Count != 0)
|
||||
if (baseBuffers.Length != 0)
|
||||
{
|
||||
baseHandles = new List<IRegionHandle>();
|
||||
foreach (Buffer buffer in baseBuffers)
|
||||
foreach (RangeItem<Buffer> item in baseBuffers)
|
||||
{
|
||||
if (buffer._useGranular)
|
||||
if (item.Value._useGranular)
|
||||
{
|
||||
baseHandles.AddRange((buffer._memoryTrackingGranular.GetHandles()));
|
||||
baseHandles.AddRange((item.Value._memoryTrackingGranular.GetHandles()));
|
||||
}
|
||||
else
|
||||
{
|
||||
baseHandles.Add(buffer._memoryTracking);
|
||||
baseHandles.Add(item.Value._memoryTracking);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue