mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-06-27 22:59:05 +00:00
Memory changes 3 (ryubing/ryujinx!202)
See merge request ryubing/ryujinx!202
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user