Example #1
0
        public void ProcessReverb3d(CommandList context, ref Reverb3dState state)
        {
            Debug.Assert(Parameter.IsChannelCountValid());

            if (IsEffectEnabled && Parameter.IsChannelCountValid())
            {
                Span <IntPtr> inputBuffers  = stackalloc IntPtr[Parameter.ChannelCount];
                Span <IntPtr> outputBuffers = stackalloc IntPtr[Parameter.ChannelCount];

                for (int i = 0; i < Parameter.ChannelCount; i++)
                {
                    inputBuffers[i]  = context.GetBufferPointer(InputBufferIndices[i]);
                    outputBuffers[i] = context.GetBufferPointer(OutputBufferIndices[i]);
                }

                switch (Parameter.ChannelCount)
                {
                case 1:
                    ProcessReverb3dMono(ref state, outputBuffers, inputBuffers, context.SampleCount);
                    break;

                case 2:
                    ProcessReverb3dStereo(ref state, outputBuffers, inputBuffers, context.SampleCount);
                    break;

                case 4:
                    ProcessReverb3dQuadraphonic(ref state, outputBuffers, inputBuffers, context.SampleCount);
                    break;

                case 6:
                    ProcessReverb3dSurround(ref state, outputBuffers, inputBuffers, context.SampleCount);
                    break;

                default:
                    throw new NotImplementedException(Parameter.ChannelCount.ToString());
                }
            }
            else
            {
                for (int i = 0; i < Parameter.ChannelCount; i++)
                {
                    if (InputBufferIndices[i] != OutputBufferIndices[i])
                    {
                        context.CopyBuffer(OutputBufferIndices[i], InputBufferIndices[i]);
                    }
                }
            }
        }
Example #2
0
 public void Process(CommandList context)
 {
     context.CopyBuffer(OutputBufferIndex, InputBufferIndex);
 }