aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/ALu.c6
-rw-r--r--Alc/mixer_inc.c11
-rw-r--r--OpenAL32/Include/alSource.h2
3 files changed, 14 insertions, 5 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index b7209172..821160a8 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -384,6 +384,9 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
}
}
ALSource->Hrtf.Counter = 0;
+ ALSource->Params.Direct.Hrtf.IrSize = GetHrtfIrSize(Device->Hrtf);
+
+ ALSource->Params.Direct.hrtfState = &ALSource->Hrtf;
}
else
{
@@ -815,6 +818,9 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
ALSource->Params.Direct.Hrtf.Dir[1] = Position[1];
ALSource->Params.Direct.Hrtf.Dir[2] = Position[2];
}
+ ALSource->Params.Direct.Hrtf.IrSize = GetHrtfIrSize(Device->Hrtf);
+
+ ALSource->Params.Direct.hrtfState = &ALSource->Hrtf;
}
else
{
diff --git a/Alc/mixer_inc.c b/Alc/mixer_inc.c
index 1d9ac5cd..a581d5ac 100644
--- a/Alc/mixer_inc.c
+++ b/Alc/mixer_inc.c
@@ -36,20 +36,21 @@ void MixDirect_Hrtf(ALsource *Source, ALCdevice *Device, DirectParams *params,
ALfloat (*RESTRICT DryBuffer)[BUFFERSIZE] = Device->DryBuffer;
ALfloat *RESTRICT ClickRemoval = Device->ClickRemoval;
ALfloat *RESTRICT PendingClicks = Device->PendingClicks;
- const ALuint IrSize = GetHrtfIrSize(Device->Hrtf);
+ const ALuint IrSize = params->Hrtf.IrSize;
const ALint *RESTRICT DelayStep = params->Hrtf.DelayStep;
ALfloat (*RESTRICT CoeffStep)[2] = params->Hrtf.CoeffStep;
ALfloat (*RESTRICT TargetCoeffs)[2] = params->Hrtf.Coeffs[srcchan];
ALuint *RESTRICT TargetDelay = params->Hrtf.Delay[srcchan];
- ALfloat *RESTRICT History = Source->Hrtf.History[srcchan];
- ALfloat (*RESTRICT Values)[2] = Source->Hrtf.Values[srcchan];
- ALint Counter = maxu(Source->Hrtf.Counter, OutPos) - OutPos;
- ALuint Offset = Source->Hrtf.Offset + OutPos;
+ ALfloat *RESTRICT History = params->hrtfState->History[srcchan];
+ ALfloat (*RESTRICT Values)[2] = params->hrtfState->Values[srcchan];
+ ALint Counter = maxu(params->hrtfState->Counter, OutPos) - OutPos;
+ ALuint Offset = params->hrtfState->Offset + OutPos;
ALIGN(16) ALfloat Coeffs[HRIR_LENGTH][2];
ALuint Delay[2];
ALfloat left, right;
ALuint pos;
ALuint c;
+ (void)Source;
pos = 0;
for(c = 0;c < IrSize;c++)
diff --git a/OpenAL32/Include/alSource.h b/OpenAL32/Include/alSource.h
index 005663bd..1a4410e4 100644
--- a/OpenAL32/Include/alSource.h
+++ b/OpenAL32/Include/alSource.h
@@ -43,10 +43,12 @@ typedef struct HrtfParams {
ALIGN(16) ALfloat CoeffStep[HRIR_LENGTH][2];
ALuint Delay[MaxChannels][2];
ALint DelayStep[2];
+ ALuint IrSize;
} HrtfParams;
typedef struct DirectParams {
HrtfParams Hrtf;
+ HrtfState *hrtfState;
/* A mixing matrix. First subscript is the channel number of the input data
* (regardless of channel configuration) and the second is the channel