From dfb81ff42de27b474d27e5d9e30c8fbe538db5ca Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 28 Mar 2019 09:29:20 -0700 Subject: Avoid using the HRTF history buffer as a ring buffer The HRTF mixers now get a full input buffer with the history prepended, so the delay offsets just need to account for the start point and read forward for each sample. --- OpenAL32/Include/alMain.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'OpenAL32') diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index fe3a8bdc..3226e582 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -30,6 +30,7 @@ #include "alnumeric.h" #include "threads.h" #include "ambidefs.h" +#include "hrtf.h" template @@ -402,7 +403,10 @@ struct ALCdevice { alignas(16) ALfloat SourceData[BUFFERSIZE + MAX_RESAMPLE_PADDING*2]; alignas(16) ALfloat ResampledData[BUFFERSIZE]; alignas(16) ALfloat FilteredData[BUFFERSIZE]; - alignas(16) ALfloat NfcSampleData[BUFFERSIZE]; + union { + alignas(16) ALfloat HrtfSourceData[BUFFERSIZE + HRTF_HISTORY_LENGTH]; + alignas(16) ALfloat NfcSampleData[BUFFERSIZE]; + }; /* Mixing buffer used by the Dry mix and Real output. */ al::vector, 16> MixBuffer; -- cgit v1.2.3