From cc91490b6104b5304655c6e4367371ea929d20bb Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 29 Mar 2019 11:28:38 -0700 Subject: Use a temporary buffer for HRTF filter accumulation Similar to the history buffer, to avoid using the state buffer as a ring buffer. --- OpenAL32/Include/alMain.h | 1 + OpenAL32/Include/alu.h | 13 ++++++------- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'OpenAL32/Include') diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 3226e582..daa3a09a 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -407,6 +407,7 @@ struct ALCdevice { alignas(16) ALfloat HrtfSourceData[BUFFERSIZE + HRTF_HISTORY_LENGTH]; alignas(16) ALfloat NfcSampleData[BUFFERSIZE]; }; + alignas(16) float2 HrtfAccumData[BUFFERSIZE + HRIR_LENGTH]; /* Mixing buffer used by the Dry mix and Real output. */ al::vector, 16> MixBuffer; diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index 6cdd7d9f..fb0d7d37 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -298,15 +298,14 @@ using RowMixerFunc = void(*)(ALfloat *OutBuffer, const ALfloat *gains, const ALfloat (*data)[BUFFERSIZE], const ALsizei InChans, const ALsizei InPos, const ALsizei BufferSize); using HrtfMixerFunc = void(*)(ALfloat *RESTRICT LeftOut, ALfloat *RESTRICT RightOut, - const ALfloat *data, ALsizei Offset, const ALsizei OutPos, const ALsizei IrSize, - MixHrtfParams *hrtfparams, HrtfState *hrtfstate, const ALsizei BufferSize); + const ALfloat *data, float2 *RESTRICT AccumSamples, const ALsizei OutPos, const ALsizei IrSize, + MixHrtfParams *hrtfparams, const ALsizei BufferSize); using HrtfMixerBlendFunc = void(*)(ALfloat *RESTRICT LeftOut, ALfloat *RESTRICT RightOut, - const ALfloat *data, ALsizei Offset, const ALsizei OutPos, const ALsizei IrSize, - const HrtfParams *oldparams, MixHrtfParams *newparams, HrtfState *hrtfstate, - const ALsizei BufferSize); + const ALfloat *data, float2 *RESTRICT AccumSamples, const ALsizei OutPos, const ALsizei IrSize, + const HrtfParams *oldparams, MixHrtfParams *newparams, const ALsizei BufferSize); using HrtfDirectMixerFunc = void(*)(ALfloat *RESTRICT LeftOut, ALfloat *RESTRICT RightOut, - const ALfloat (*data)[BUFFERSIZE], DirectHrtfState *State, const ALsizei NumChans, - const ALsizei BufferSize); + const ALfloat (*data)[BUFFERSIZE], float2 *RESTRICT AccumSamples, DirectHrtfState *State, + const ALsizei NumChans, const ALsizei BufferSize); #define GAIN_MIX_MAX (1000.0f) /* +60dB */ -- cgit v1.2.3