1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-12-18 22:42:06 +00:00
Ryujinx/src/Ryujinx.Cpu
jhorv ead9a25141
Audio rendering: reduce memory allocations (#6604)
* - WritableRegion: enable wrapping IMemoryOwner<byte>
- IVirtualMemoryManager impls of GetWritableRegion() use pooled memory when region is non-contiguous.
- IVirtualMemoryManager: add GetReadOnlySequence() and impls
- ByteMemoryPool: add new method RentCopy()
- ByteMemoryPool: make class static, remove ctor and singleton field from earlier impl

* - BytesReadOnlySequenceSegment: move from Ryujinx.Common.Memory to Ryujinx.Memory
- BytesReadOnlySequenceSegment: add IsContiguousWith() and Replace() methods
- VirtualMemoryManagerBase:
  - remove generic type parameters, instead use ulong for virtual addresses and nuint for host/physical addresses
  - implement IWritableBlock
  - add virtual GetReadOnlySequence() with coalescing of contiguous segments
  - add virtual GetSpan()
  - add virtual GetWritableRegion()
  - add abstract IsMapped()
  - add virtual MapForeign(ulong, nuint, ulong)
  - add virtual Read<T>()
  - add virtual Read(ulong, Span<byte>)
  - add virtual ReadTracked<T>()
  - add virtual SignalMemoryTracking()
  - add virtual Write()
  - add virtual Write<T>()
  - add virtual WriteUntracked()
  - add virtual WriteWithRedundancyCheck()
- VirtualMemoryManagerRefCountedBase: remove generic type parameters
- AddressSpaceManager: remove redundant methods, add required overrides
- HvMemoryManager: remove redundant methods, add required overrides, add overrides for _invalidAccessHandler handling
- MemoryManager: remove redundant methods, add required overrides, add overrides for _invalidAccessHandler handling
- MemoryManagerHostMapped: remove redundant methods, add required overrides, add overrides for _invalidAccessHandler handling
- NativeMemoryManager: add get properties for Pointer and Length
- throughout: removed invalid <inheritdoc/> comments

* - WritableRegion: enable wrapping IMemoryOwner<byte>
- IVirtualMemoryManager impls of GetWritableRegion() use pooled memory when region is non-contiguous.
- IVirtualMemoryManager: add GetReadOnlySequence() and impls
- ByteMemoryPool: add new method RentCopy()
- ByteMemoryPool: make class static, remove ctor and singleton field from earlier impl

* add PagedMemoryRange enumerator types, use them in IVirtualMemoryManager implementations to consolidate page-handling logic and add a new capability - the coalescing of pages for consolidating memory copies and segmentation.

* new: more tests for PagedMemoryRangeCoalescingEnumerator showing coalescing of contiguous segments

* make some struct properties readonly

* put braces around `foreach` bodies

* encourage inlining of some PagedMemoryRange*Enumerator members

* DynamicRingBuffer:
 - use ByteMemoryPool
 - make some methods return without locking when size/count argument = 0
 - make generic Read<T>()/Write<T>() non-generic because its only usage is as T = byte
 - change Read(byte[]...) to Read(Span<byte>...)
 - change Write(byte[]...) to Write(Span<byte>...)

* change IAudioRenderer.RequestUpdate() to take a ReadOnlySequence<byte>, enabling zero-copy audio rendering

* HipcGenerator: support ReadOnlySequence<byte> as IPC method parameter

* change IAudioRenderer/AudioRenderer RequestUpdate* methods to take input as ReadOnlySequence<byte>

* MemoryManagerHostTracked: use rented memory when contiguous in `GetWritableRegion()`

* rebase cleanup

* dotnet format fixes

* format and comment fixes

* format long parameter list - take 2

* - add support to HipcGenerator for buffers of type `Memory<byte>`
- change `AudioRenderer` `RequestUpdate()` and `RequestUpdateAuto()` to use Memory<byte> for output buffers, removing another memory block allocation/copy

* SplitterContext `UpdateState()` and `UpdateData()` smooth out advance/rewind logic, only rewind if magic is invalid

* DynamicRingBuffer.Write(): change Span<byte> to ReadOnlySpan<byte>
2024-04-07 18:07:32 -03:00
..
AppleHv Delete old 16KB page workarounds (#6584) 2024-04-06 13:51:44 -03:00
Jit Audio rendering: reduce memory allocations (#6604) 2024-04-07 18:07:32 -03:00
LightningJit Implement host tracked memory manager mode (#6356) 2024-03-26 23:33:24 -03:00
Signal Implement host tracked memory manager mode (#6356) 2024-03-26 23:33:24 -03:00
AddressSpace.cs Delete old 16KB page workarounds (#6584) 2024-04-06 13:51:44 -03:00
DummyDiskCacheLoadState.cs Implement a new JIT for Arm devices (#6057) 2024-01-20 11:11:28 -03:00
ExceptionCallbacks.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00
ICpuContext.cs Implement a new JIT for Arm devices (#6057) 2024-01-20 11:11:28 -03:00
ICpuEngine.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00
IDiskCacheState.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00
IExecutionContext.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00
ITickSource.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00
IVirtualMemoryManagerTracked.cs Separate guest/host tracking + unaligned protection (#6486) 2024-03-14 19:38:27 -03:00
LoadState.cs [Ryujinx.Cpu] Address dotnet-format issues (#5365) 2023-07-01 02:18:52 +00:00
ManagedPageFlags.cs Separate guest/host tracking + unaligned protection (#6486) 2024-03-14 19:38:27 -03:00
MemoryEhMeilleure.cs Implement host tracked memory manager mode (#6356) 2024-03-26 23:33:24 -03:00
MemoryHelper.cs editorconfig: Set default encoding to UTF-8 (#5793) 2023-12-04 14:17:13 +01:00
PrivateMemoryAllocation.cs [Ryujinx.Cpu] Address dotnet-format issues (#5365) 2023-07-01 02:18:52 +00:00
PrivateMemoryAllocator.cs Implement host tracked memory manager mode (#6356) 2024-03-26 23:33:24 -03:00
Ryujinx.Cpu.csproj Migrate to .NET 8 (#5887) 2023-11-15 17:41:31 +01:00
TickSource.cs [Ryujinx.Cpu] Address dotnet-format issues (#5365) 2023-07-01 02:18:52 +00:00
VirtualMemoryManagerRefCountedBase.cs Add support to IVirtualMemoryManager for zero-copy reads (#6251) 2024-04-04 22:23:03 -03:00