aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Audio/Renderer/Dsp/Command/DownMixSurroundToStereoCommand.cs
diff options
context:
space:
mode:
authorMary <me@thog.eu>2021-07-18 13:05:11 +0200
committerGitHub <noreply@github.com>2021-07-18 13:05:11 +0200
commitb8ad676fb8cbe0a43617df41daaf284ab4421c75 (patch)
tree743775369a175af0859f3e27e14e4ed4ce8b6877 /Ryujinx.Audio/Renderer/Dsp/Command/DownMixSurroundToStereoCommand.cs
parent97a21332071aceeef6f5035178a3523177570448 (diff)
Amadeus: DSP code generation improvements (#2460)
This improve RyuJIT codegen drastically on the DSP side. This may reduce CPU usage of the DSP thread quite a lot.
Diffstat (limited to 'Ryujinx.Audio/Renderer/Dsp/Command/DownMixSurroundToStereoCommand.cs')
-rw-r--r--Ryujinx.Audio/Renderer/Dsp/Command/DownMixSurroundToStereoCommand.cs16
1 files changed, 6 insertions, 10 deletions
diff --git a/Ryujinx.Audio/Renderer/Dsp/Command/DownMixSurroundToStereoCommand.cs b/Ryujinx.Audio/Renderer/Dsp/Command/DownMixSurroundToStereoCommand.cs
index f81a2849..1c62ef07 100644
--- a/Ryujinx.Audio/Renderer/Dsp/Command/DownMixSurroundToStereoCommand.cs
+++ b/Ryujinx.Audio/Renderer/Dsp/Command/DownMixSurroundToStereoCommand.cs
@@ -35,7 +35,7 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
public float[] Coefficients { get; }
- public DownMixSurroundToStereoCommand(uint bufferOffset, Span<byte> inputBufferOffset, Span<byte> outputBufferOffset, ReadOnlySpan<float> downMixParameter, int nodeId)
+ public DownMixSurroundToStereoCommand(uint bufferOffset, Span<byte> inputBufferOffset, Span<byte> outputBufferOffset, float[] downMixParameter, int nodeId)
{
Enabled = true;
NodeId = nodeId;
@@ -49,7 +49,7 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
OutputBufferIndices[i] = (ushort)(bufferOffset + outputBufferOffset[i]);
}
- Coefficients = downMixParameter.ToArray();
+ Coefficients = downMixParameter;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -69,10 +69,6 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
Span<float> stereoLeft = context.GetBuffer(OutputBufferIndices[0]);
Span<float> stereoRight = context.GetBuffer(OutputBufferIndices[1]);
- Span<float> unused2 = context.GetBuffer(OutputBufferIndices[2]);
- Span<float> unused3 = context.GetBuffer(OutputBufferIndices[3]);
- Span<float> unused4 = context.GetBuffer(OutputBufferIndices[4]);
- Span<float> unused5 = context.GetBuffer(OutputBufferIndices[5]);
for (int i = 0; i < context.SampleCount; i++)
{
@@ -80,10 +76,10 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
stereoRight[i] = DownMixSurroundToStereo(Coefficients, backRight[i], lowFrequency[i], frontCenter[i], frontRight[i]);
}
- unused2.Fill(0);
- unused3.Fill(0);
- unused4.Fill(0);
- unused5.Fill(0);
+ context.ClearBuffer(OutputBufferIndices[2]);
+ context.ClearBuffer(OutputBufferIndices[3]);
+ context.ClearBuffer(OutputBufferIndices[4]);
+ context.ClearBuffer(OutputBufferIndices[5]);
}
}
}