aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/mixer_c.c4
-rw-r--r--Alc/mixer_sse.c12
2 files changed, 15 insertions, 1 deletions
diff --git a/Alc/mixer_c.c b/Alc/mixer_c.c
index cab3f8af..44ef5ded 100644
--- a/Alc/mixer_c.c
+++ b/Alc/mixer_c.c
@@ -100,9 +100,13 @@ void MixDirect_C(ALsource *Source, ALCdevice *Device, DirectParams *params,
}
for(c = 0;c < MaxChannels;c++)
{
+ if(DrySend[c] < 0.00001f)
+ continue;
+
for(pos = 0;pos < BufferSize;pos++)
DryBuffer[c][OutPos+pos] += data[pos]*DrySend[c];
}
+ pos = BufferSize;
if(OutPos+pos == SamplesToDo)
{
for(c = 0;c < MaxChannels;c++)
diff --git a/Alc/mixer_sse.c b/Alc/mixer_sse.c
index d366ca8a..d2ea7439 100644
--- a/Alc/mixer_sse.c
+++ b/Alc/mixer_sse.c
@@ -156,7 +156,12 @@ void MixDirect_SSE(ALsource *Source, ALCdevice *Device, DirectParams *params,
}
for(c = 0;c < MaxChannels;c++)
{
- const __m128 gain = _mm_set1_ps(DrySend[c]);
+ __m128 gain;
+
+ if(DrySend[c] < 0.00001f)
+ continue;
+
+ gain = _mm_set1_ps(DrySend[c]);
for(pos = 0;pos < BufferSize-3;pos += 4)
{
const __m128 val4 = _mm_load_ps(&data[pos]);
@@ -165,15 +170,20 @@ void MixDirect_SSE(ALsource *Source, ALCdevice *Device, DirectParams *params,
_mm_store_ps(&DryBuffer[c][OutPos+pos], dry4);
}
}
+ pos = BufferSize&~3;
if(pos < BufferSize)
{
ALuint oldpos = pos;
for(c = 0;c < MaxChannels;c++)
{
+ if(DrySend[c] < 0.00001f)
+ continue;
+
pos = oldpos;
for(;pos < BufferSize;pos++)
DryBuffer[c][OutPos+pos] += data[pos]*DrySend[c];
}
+ pos = BufferSize;
}
if(OutPos+pos == SamplesToDo)
{