diff options
author | jhorv <38920027+jhorv@users.noreply.github.com> | 2024-08-03 14:50:53 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-03 19:50:53 +0100 |
commit | 59ddb26628fc2ab94f1c274a254c76b3e368f8b6 (patch) | |
tree | 57a91040e67a4afb1aec5350704990592efe1acc /src/Ryujinx.Graphics.Texture/Astc | |
parent | 83fda10f6ef68950de395b5f9f6ab0bf58adced4 (diff) |
replace ByteMemoryPool usage in Ryujinx.Graphics (#7129)1.1.1366
* 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.Texture/Astc')
-rw-r--r-- | src/Ryujinx.Graphics.Texture/Astc/AstcDecoder.cs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Ryujinx.Graphics.Texture/Astc/AstcDecoder.cs b/src/Ryujinx.Graphics.Texture/Astc/AstcDecoder.cs index 3f65e122..92e39d2e 100644 --- a/src/Ryujinx.Graphics.Texture/Astc/AstcDecoder.cs +++ b/src/Ryujinx.Graphics.Texture/Astc/AstcDecoder.cs @@ -1,7 +1,6 @@ using Ryujinx.Common.Memory; using Ryujinx.Common.Utilities; using System; -using System.Buffers; using System.Diagnostics; using System.Linq; using System.Runtime.CompilerServices; @@ -293,9 +292,9 @@ namespace Ryujinx.Graphics.Texture.Astc int depth, int levels, int layers, - out IMemoryOwner<byte> decoded) + out MemoryOwner<byte> decoded) { - decoded = ByteMemoryPool.Rent(QueryDecompressedSize(width, height, depth, levels, layers)); + decoded = MemoryOwner<byte>.Rent(QueryDecompressedSize(width, height, depth, levels, layers)); AstcDecoder decoder = new(data, decoded.Memory, blockWidth, blockHeight, width, height, depth, levels, layers); |