aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs
diff options
context:
space:
mode:
authorjhorv <38920027+jhorv@users.noreply.github.com>2024-08-03 14:50:53 -0400
committerGitHub <noreply@github.com>2024-08-03 19:50:53 +0100
commit59ddb26628fc2ab94f1c274a254c76b3e368f8b6 (patch)
tree57a91040e67a4afb1aec5350704990592efe1acc /src/Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs
parent83fda10f6ef68950de395b5f9f6ab0bf58adced4 (diff)
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>
Diffstat (limited to 'src/Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs')
-rw-r--r--src/Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs b/src/Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs
index 4d09c3aa..b22cc01b 100644
--- a/src/Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs
+++ b/src/Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs
@@ -192,9 +192,9 @@ namespace Ryujinx.Graphics.Gpu.Memory
}
else
{
- IMemoryOwner<byte> memoryOwner = ByteMemoryPool.Rent(range.GetSize());
+ MemoryOwner<byte> memoryOwner = MemoryOwner<byte>.Rent(checked((int)range.GetSize()));
- Memory<byte> memory = memoryOwner.Memory;
+ Span<byte> memorySpan = memoryOwner.Span;
int offset = 0;
for (int i = 0; i < range.Count; i++)
@@ -203,7 +203,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
int size = (int)currentRange.Size;
if (currentRange.Address != MemoryManager.PteUnmapped)
{
- GetSpan(currentRange.Address, size).CopyTo(memory.Span.Slice(offset, size));
+ GetSpan(currentRange.Address, size).CopyTo(memorySpan.Slice(offset, size));
}
offset += size;
}