Memory changes 3

General memory improvements to decrease GC pressure and frequency.

Pool big arrays and objects that are created and deleted often.

Skip data copies when they aren't needed.

Inline flag checks to skip unneeded allocations.

From my testing the performance is about the same, but the GC frequency is much lower and collection is faster causing less and smaller spikes.
This commit is contained in:
LotP authored and KeatonTheBot committed 2025-10-30 23:25:51 -05:00
1 parent 2c50fbcc1f
commit e3ee28605d
42 files changed
+703 -331

No files matched your search

@@ -182,17 +182,16 @@ namespace Ryujinx.Graphics.Vulkan
{
if (_forcedFences.Count > 0)
{
_forcedFences.RemoveAll((entry) =>
for (int i = 0; i < _forcedFences.Count; i++)
{
if (entry.Texture.Disposed)
if (_forcedFences[i].Texture.Disposed)
{
return true;
_forcedFences.RemoveAt(i--);
continue;
}
entry.Texture.QueueWriteToReadBarrier(cbs, AccessFlags.ShaderReadBit, entry.StageFlags);
return false;
});
_forcedFences[i].Texture.QueueWriteToReadBarrier(cbs, AccessFlags.ShaderReadBit, _forcedFences[i].StageFlags);
}
}
}