aboutsummaryrefslogtreecommitdiffstats
path: root/alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-03-25 22:24:09 -0700
committerChris Robinson <[email protected]>2020-03-25 22:24:09 -0700
commite8149ec509b9ab71b03b2e5059b6a44fcdc42c40 (patch)
tree24d1dd9f5416ecafc860a879414572064eadc1e1 /alc
parenta27096dd6305bbbdc470371ce8807e1e1bf331c1 (diff)
Move some setup to a more logical place
Diffstat (limited to 'alc')
-rw-r--r--alc/alu.cpp33
-rw-r--r--alc/voice.cpp35
2 files changed, 34 insertions, 34 deletions
diff --git a/alc/alu.cpp b/alc/alu.cpp
index 13e57a09..f50815ae 100644
--- a/alc/alu.cpp
+++ b/alc/alu.cpp
@@ -122,9 +122,6 @@ const ALfloat ConeScale{InitConeScale()};
/* Localized Z scalar for mono sources */
const ALfloat ZScale{InitZScale()};
-MixerFunc MixSamples{Mix_<CTag>};
-RowMixerFunc MixRowSamples{MixRow_<CTag>};
-
namespace {
struct ChanMap {
@@ -133,33 +130,7 @@ struct ChanMap {
ALfloat elevation;
};
-HrtfDirectMixerFunc MixDirectHrtf = MixDirectHrtf_<CTag>;
-
-inline MixerFunc SelectMixer()
-{
-#ifdef HAVE_NEON
- if((CPUCapFlags&CPU_CAP_NEON))
- return Mix_<NEONTag>;
-#endif
-#ifdef HAVE_SSE
- if((CPUCapFlags&CPU_CAP_SSE))
- return Mix_<SSETag>;
-#endif
- return Mix_<CTag>;
-}
-
-inline RowMixerFunc SelectRowMixer()
-{
-#ifdef HAVE_NEON
- if((CPUCapFlags&CPU_CAP_NEON))
- return MixRow_<NEONTag>;
-#endif
-#ifdef HAVE_SSE
- if((CPUCapFlags&CPU_CAP_SSE))
- return MixRow_<SSETag>;
-#endif
- return MixRow_<CTag>;
-}
+HrtfDirectMixerFunc MixDirectHrtf{MixDirectHrtf_<CTag>};
inline HrtfDirectMixerFunc SelectHrtfMixer(void)
{
@@ -256,8 +227,6 @@ inline ResamplerFunc SelectResampler(Resampler resampler, ALuint increment)
void aluInit(void)
{
- MixSamples = SelectMixer();
- MixRowSamples = SelectRowMixer();
MixDirectHrtf = SelectHrtfMixer();
}
diff --git a/alc/voice.cpp b/alc/voice.cpp
index 369c2ad4..d09aa700 100644
--- a/alc/voice.cpp
+++ b/alc/voice.cpp
@@ -71,6 +71,9 @@ static_assert((INT_MAX>>FRACTIONBITS)/MAX_PITCH > BUFFERSIZE,
Resampler ResamplerDefault{Resampler::Linear};
+MixerFunc MixSamples{Mix_<CTag>};
+RowMixerFunc MixRowSamples{MixRow_<CTag>};
+
namespace {
using HrtfMixerFunc = void(*)(const ALfloat *InSamples, float2 *AccumSamples, const ALuint IrSize,
@@ -79,8 +82,34 @@ using HrtfMixerBlendFunc = void(*)(const ALfloat *InSamples, float2 *AccumSample
const ALuint IrSize, const HrtfFilter *oldparams, const MixHrtfFilter *newparams,
const size_t BufferSize);
-HrtfMixerFunc MixHrtfSamples = MixHrtf_<CTag>;
-HrtfMixerBlendFunc MixHrtfBlendSamples = MixHrtfBlend_<CTag>;
+HrtfMixerFunc MixHrtfSamples{MixHrtf_<CTag>};
+HrtfMixerBlendFunc MixHrtfBlendSamples{MixHrtfBlend_<CTag>};
+
+inline MixerFunc SelectMixer()
+{
+#ifdef HAVE_NEON
+ if((CPUCapFlags&CPU_CAP_NEON))
+ return Mix_<NEONTag>;
+#endif
+#ifdef HAVE_SSE
+ if((CPUCapFlags&CPU_CAP_SSE))
+ return Mix_<SSETag>;
+#endif
+ return Mix_<CTag>;
+}
+
+inline RowMixerFunc SelectRowMixer()
+{
+#ifdef HAVE_NEON
+ if((CPUCapFlags&CPU_CAP_NEON))
+ return MixRow_<NEONTag>;
+#endif
+#ifdef HAVE_SSE
+ if((CPUCapFlags&CPU_CAP_SSE))
+ return MixRow_<SSETag>;
+#endif
+ return MixRow_<CTag>;
+}
inline HrtfMixerFunc SelectHrtfMixer()
{
@@ -150,6 +179,8 @@ void aluInitMixer()
ResamplerDefault = iter->resampler;
}
+ MixSamples = SelectMixer();
+ MixRowSamples = SelectRowMixer();
MixHrtfBlendSamples = SelectHrtfBlendMixer();
MixHrtfSamples = SelectHrtfMixer();
}