diff options
author | Chris Robinson <[email protected]> | 2018-09-11 18:39:50 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-09-11 18:39:50 -0700 |
commit | 99737469e2678a6169462c8488b6f6080c7857b6 (patch) | |
tree | 275ed4b38744f825230b5b5f21b2ff8689874718 | |
parent | b13396cce273c2154893976a9e33b87ae7e9d085 (diff) |
Ensure the max reverb update size is a multiple of 4
It's not an issue for the final mix, but if one loop has an unaligned count,
the next loop will have unaligned input and output buffer targets which can
crash the SSE mixers.
-rw-r--r-- | Alc/effects/reverb.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Alc/effects/reverb.c b/Alc/effects/reverb.c index 2a6aea35..a32b1de4 100644 --- a/Alc/effects/reverb.c +++ b/Alc/effects/reverb.c @@ -948,9 +948,11 @@ static ALvoid ALreverbState_update(ALreverbState *State, const ALCcontext *Conte props->Reverb.ReflectionsGain*gain, props->Reverb.LateReverbGain*gain, State); - /* Calculate the max update size from the smallest relevant delay. */ + /* Calculate the max update size from the smallest relevant delay, ensuring + * the update size is a multiple of 4 for SIMD. + */ State->MaxUpdate[1] = mini(MAX_UPDATE_SAMPLES, - mini(State->Early.Offset[0][1], State->Late.Offset[0][1]) + mini(State->Early.Offset[0][1], State->Late.Offset[0][1])&~3 ); /* Determine if delay-line cross-fading is required. TODO: Add some fuzz |