diff options
| author | riperiperi <rhy3756547@hotmail.com> | 2021-10-07 13:43:31 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-07 13:43:31 +0100 |
| commit | 468774578dfd10342b35ebb66779c1521a91617c (patch) | |
| tree | 5bfdb076182bac84d4747dc8c2143b259a87476c /Ryujinx.Graphics.Gpu/Memory/Buffer.cs | |
| parent | ecc64c934da43f881c2821bc9bc52ee42e55af2f (diff) | |
| parent | a4956591ec485e9b23ded32a853f2a63af92b769 (diff) | |
Merge pull request #2713 from riperiperi/fix/modified-inherit
Reregister flush actions when taking a buffer's modified range list.
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Memory/Buffer.cs')
| -rw-r--r-- | Ryujinx.Graphics.Gpu/Memory/Buffer.cs | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/Ryujinx.Graphics.Gpu/Memory/Buffer.cs b/Ryujinx.Graphics.Gpu/Memory/Buffer.cs index 0eaf0123..81f70684 100644 --- a/Ryujinx.Graphics.Gpu/Memory/Buffer.cs +++ b/Ryujinx.Graphics.Gpu/Memory/Buffer.cs @@ -299,24 +299,28 @@ namespace Ryujinx.Graphics.Gpu.Memory _syncActionRegistered = true; } + Action<ulong, ulong> registerRangeAction = (ulong address, ulong size) => + { + if (_useGranular) + { + _memoryTrackingGranular.RegisterAction(address, size, _externalFlushDelegate); + } + else + { + _memoryTracking.RegisterAction(_externalFlushDelegate); + } + }; + if (_modifiedRanges == null) { _modifiedRanges = from._modifiedRanges; + _modifiedRanges.ReregisterRanges(registerRangeAction); + from._modifiedRanges = null; } else { - _modifiedRanges.InheritRanges(from._modifiedRanges, (ulong address, ulong size) => - { - if (_useGranular) - { - _memoryTrackingGranular.RegisterAction(address, size, _externalFlushDelegate); - } - else - { - _memoryTracking.RegisterAction(_externalFlushDelegate); - } - }); + _modifiedRanges.InheritRanges(from._modifiedRanges, registerRangeAction); } } } |
