replace ByteMemoryPool usage in Ryujinx.Graphics (#7129)
* chore: replace `ByteMemoryPool` usage with `MemoryOwner<byte>` * refactor: `PixelConverter.ConvertR4G4ToR4G4B4A4()` - rename old `outputSpan` to `outputSpanUInt16`, reuse same output `Span<byte>` as newly-freed name `outputSpan` * eliminate temporary buffer allocations * chore, perf: use MemoryOwner<byte> instead of IMemoryOwner<byte>
This commit is contained in:
parent
83fda10f6e
commit
59ddb26628
13 changed files with 73 additions and 80 deletions
|
@ -2,7 +2,6 @@ using Ryujinx.Common.Memory;
|
|||
using Ryujinx.Memory;
|
||||
using Ryujinx.Memory.Range;
|
||||
using System;
|
||||
using System.Buffers;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
@ -242,9 +241,9 @@ namespace Ryujinx.Graphics.Gpu.Memory
|
|||
}
|
||||
else
|
||||
{
|
||||
IMemoryOwner<byte> memoryOwner = ByteMemoryPool.Rent(size);
|
||||
MemoryOwner<byte> memoryOwner = MemoryOwner<byte>.Rent(size);
|
||||
|
||||
GetSpan(va, size).CopyTo(memoryOwner.Memory.Span);
|
||||
ReadImpl(va, memoryOwner.Span, tracked);
|
||||
|
||||
return new WritableRegion(this, va, memoryOwner, tracked);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue