See merge request ryubing/ryujinx!202
This commit is contained in:
LotP
2025-10-30 20:55:58 -05:00
parent ab7aeee67b
commit 92b61f9d73
43 changed files with 686 additions and 315 deletions

View File

@@ -93,6 +93,9 @@ namespace Ryujinx.Graphics.Gpu.Memory
private ulong _dirtyStart = ulong.MaxValue;
private ulong _dirtyEnd = ulong.MaxValue;
private readonly Action<ulong, ulong> _syncPreRangeAction;
private readonly Action<ulong, ulong> _syncRangeAction;
/// <summary>
/// Creates a new instance of the buffer.
/// </summary>
@@ -177,6 +180,9 @@ namespace Ryujinx.Graphics.Gpu.Memory
_modifiedDelegate = RegionModified;
_virtualDependenciesLock = new ReaderWriterLockSlim();
_syncPreRangeAction = SyncPreRangeAction;
_syncRangeAction = SyncRangeAction;
}
/// <summary>
@@ -401,13 +407,15 @@ namespace Ryujinx.Graphics.Gpu.Memory
if (_preFlush.ShouldCopy)
{
_modifiedRanges?.GetRangesAtSync(Address, Size, _context.SyncNumber, (address, size) =>
{
_preFlush.CopyModified(address, size);
});
_modifiedRanges?.GetRangesAtSync(Address, Size, _context.SyncNumber, _syncPreRangeAction);
}
}
}
void SyncPreRangeAction(ulong address, ulong size)
{
_preFlush.CopyModified(address, size);
}
/// <summary>
/// Action to be performed when a syncpoint is reached after modification.
@@ -420,11 +428,9 @@ namespace Ryujinx.Graphics.Gpu.Memory
if (_useGranular)
{
_modifiedRanges?.GetRanges(Address, Size, (address, size) =>
{
_memoryTrackingGranular.RegisterAction(address, size, _externalFlushDelegate);
SynchronizeMemory(address, size);
});
_modifiedRanges?.GetRanges(Address, Size, _syncRangeAction);
}
else
{
@@ -434,6 +440,12 @@ namespace Ryujinx.Graphics.Gpu.Memory
return true;
}
void SyncRangeAction(ulong address, ulong size)
{
_memoryTrackingGranular.RegisterAction(address, size, _externalFlushDelegate);
SynchronizeMemory(address, size);
}
/// <summary>
/// Inherit modified and dirty ranges from another buffer.