aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services/Audio/AudioRendererManager/SplitterContext.cs
blob: e46af4432d0b260a5e3c54fd3ab3d55da3cd94f0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using Ryujinx.Common;

namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
{
    class SplitterContext
    {
        public static long CalcWorkBufferSize(BehaviorInfo behaviorInfo, AudioRendererParameter parameters)
        {
            if (!behaviorInfo.IsSplitterSupported())
            {
                return 0;
            }

            long size = parameters.SplitterDestinationDataCount * 0xE0 +
                        parameters.SplitterCount                * 0x20;

            if (!behaviorInfo.IsSplitterBugFixed())
            {
                size += BitUtils.AlignUp(4 * parameters.SplitterDestinationDataCount, 16);
            }

            return size;
        }
    }
}