mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-12-13 13:37:00 +00:00
Memory changes 3 (ryubing/ryujinx!202)
See merge request ryubing/ryujinx!202
This commit is contained in:
parent
ab7aeee67b
commit
92b61f9d73
43 changed files with 686 additions and 315 deletions
|
|
@ -1,6 +1,7 @@
|
|||
using Ryujinx.Audio.Integration;
|
||||
using Ryujinx.Audio.Renderer.Server.Sink;
|
||||
using System;
|
||||
using System.Buffers;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
|
||||
|
|
@ -35,7 +36,9 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
|
|||
Enabled = true;
|
||||
NodeId = nodeId;
|
||||
|
||||
DeviceName = Encoding.ASCII.GetString(sink.Parameter.DeviceName).TrimEnd('\0');
|
||||
// Unused and wasting time and memory, re-add if needed
|
||||
// DeviceName = Encoding.ASCII.GetString(sink.Parameter.DeviceName).TrimEnd('\0');
|
||||
|
||||
SessionId = sessionId;
|
||||
InputCount = sink.Parameter.InputCount;
|
||||
InputBufferIndices = new ushort[InputCount];
|
||||
|
|
@ -88,7 +91,7 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
|
|||
inputCount = bufferCount;
|
||||
}
|
||||
|
||||
short[] outputBuffer = new short[inputCount * SampleCount];
|
||||
short[] outputBuffer = ArrayPool<short>.Shared.Rent((int)inputCount * SampleCount);
|
||||
|
||||
for (int i = 0; i < bufferCount; i++)
|
||||
{
|
||||
|
|
@ -100,7 +103,9 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
|
|||
}
|
||||
}
|
||||
|
||||
device.AppendBuffer(outputBuffer, inputCount);
|
||||
device.AppendBuffer(outputBuffer.AsSpan(..((int)inputCount * SampleCount)), inputCount);
|
||||
|
||||
ArrayPool<short>.Shared.Return(outputBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue