From d04ba51bb0456ee8f778fe86fc224665b0fb20c8 Mon Sep 17 00:00:00 2001 From: Mary Date: Fri, 8 Apr 2022 10:52:18 +0200 Subject: amadeus: Improve and fix delay effect processing (#3205) * amadeus: Improve and fix delay effect processing This rework the delay effect processing by representing calculation with the appropriate matrix and by unrolling some loop in the code. This allows better optimization by the JIT while making it more readeable. Also fix a bug in the Surround code path found while looking back at my notes. * Remove useless GetHashCode * Address gdkchan's comments --- Ryujinx.Audio/Renderer/Utils/Math/Vector6.cs | 56 ++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 Ryujinx.Audio/Renderer/Utils/Math/Vector6.cs (limited to 'Ryujinx.Audio/Renderer/Utils/Math/Vector6.cs') diff --git a/Ryujinx.Audio/Renderer/Utils/Math/Vector6.cs b/Ryujinx.Audio/Renderer/Utils/Math/Vector6.cs new file mode 100644 index 00000000..b2cd481b --- /dev/null +++ b/Ryujinx.Audio/Renderer/Utils/Math/Vector6.cs @@ -0,0 +1,56 @@ +using System.Runtime.CompilerServices; + +namespace Ryujinx.Audio.Renderer.Utils.Math +{ + record struct Vector6 + { + public float X; + public float Y; + public float Z; + public float W; + public float V; + public float U; + + public Vector6(float value) : this(value, value, value, value, value, value) + { + } + + public Vector6(float x, float y, float z, float w, float v, float u) + { + X = x; + Y = y; + Z = z; + W = w; + V = v; + U = u; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector6 operator +(Vector6 left, Vector6 right) + { + return new Vector6(left.X + right.X, + left.Y + right.Y, + left.Z + right.Z, + left.W + right.W, + left.V + right.V, + left.U + right.U); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector6 operator *(Vector6 left, Vector6 right) + { + return new Vector6(left.X * right.X, + left.Y * right.Y, + left.Z * right.Z, + left.W * right.W, + left.V * right.V, + left.U * right.U); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector6 operator *(Vector6 left, float right) + { + return left * new Vector6(right); + } + } +} -- cgit v1.2.3