aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Texture/Astc/AstcDecoder.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx.Graphics.Texture/Astc/AstcDecoder.cs')
-rw-r--r--src/Ryujinx.Graphics.Texture/Astc/AstcDecoder.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Ryujinx.Graphics.Texture/Astc/AstcDecoder.cs b/src/Ryujinx.Graphics.Texture/Astc/AstcDecoder.cs
index edf699dc..3f65e122 100644
--- a/src/Ryujinx.Graphics.Texture/Astc/AstcDecoder.cs
+++ b/src/Ryujinx.Graphics.Texture/Astc/AstcDecoder.cs
@@ -1,5 +1,7 @@
+using Ryujinx.Common.Memory;
using Ryujinx.Common.Utilities;
using System;
+using System.Buffers;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
@@ -291,16 +293,14 @@ namespace Ryujinx.Graphics.Texture.Astc
int depth,
int levels,
int layers,
- out byte[] decoded)
+ out IMemoryOwner<byte> decoded)
{
- byte[] output = new byte[QueryDecompressedSize(width, height, depth, levels, layers)];
+ decoded = ByteMemoryPool.Rent(QueryDecompressedSize(width, height, depth, levels, layers));
- AstcDecoder decoder = new(data, output, blockWidth, blockHeight, width, height, depth, levels, layers);
+ AstcDecoder decoder = new(data, decoded.Memory, blockWidth, blockHeight, width, height, depth, levels, layers);
Enumerable.Range(0, decoder.TotalBlockCount).AsParallel().ForAll(x => decoder.ProcessBlock(x));
- decoded = output;
-
return decoder.Success;
}