diff options
author | Chris Robinson <[email protected]> | 2022-08-02 23:29:21 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-08-02 23:29:21 -0700 |
commit | 9d296a9c753909bb2f2ba5d281c6b13f112e4f4d (patch) | |
tree | 6a7dba158e088a39502c5ab1740cd935526006c7 /alc | |
parent | b286e6497fdf03e008077a8188abcaee8f579aed (diff) |
Avoid putting a 1KB array on the stack
Diffstat (limited to 'alc')
-rw-r--r-- | alc/alu.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/alc/alu.cpp b/alc/alu.cpp index ffbf87aa..bda7cf01 100644 --- a/alc/alu.cpp +++ b/alc/alu.cpp @@ -330,8 +330,6 @@ void DeviceBase::ProcessBs2b(const size_t SamplesToDo) namespace { -using AmbiRotateMatrix = std::array<std::array<float,MaxAmbiChannels>,MaxAmbiChannels>; - /* This RNG method was created based on the math found in opusdec. It's quick, * and starting with a seed value of 22222, is suitable for generating * whitenoise. @@ -673,7 +671,7 @@ struct GainTriplet { float Base, HF, LF; }; void CalcPanningAndFilters(Voice *voice, const float xpos, const float ypos, const float zpos, const float Distance, const float Spread, const GainTriplet &DryGain, const al::span<const GainTriplet,MAX_SENDS> WetGain, EffectSlot *(&SendSlots)[MAX_SENDS], - const VoiceProps *props, const ContextParams &Context, const DeviceBase *Device) + const VoiceProps *props, const ContextParams &Context, DeviceBase *Device) { static constexpr ChanMap MonoMap[1]{ { FrontCenter, 0.0f, 0.0f } @@ -866,7 +864,9 @@ void CalcPanningAndFilters(Voice *voice, const float xpos, const float ypos, con * order elements, then construct the rotation for the higher * orders. */ - AmbiRotateMatrix shrot{}; + AmbiRotateMatrix &shrot = Device->mAmbiRotateMatrix; + shrot.fill({}); + shrot[0][0] = 1.0f; shrot[1][1] = U[0]; shrot[1][2] = -V[0]; shrot[1][3] = -N[0]; shrot[2][1] = -U[1]; shrot[2][2] = V[1]; shrot[2][3] = N[1]; @@ -1246,7 +1246,7 @@ void CalcPanningAndFilters(Voice *voice, const float xpos, const float ypos, con void CalcNonAttnSourceParams(Voice *voice, const VoiceProps *props, const ContextBase *context) { - const DeviceBase *Device{context->mDevice}; + DeviceBase *Device{context->mDevice}; EffectSlot *SendSlots[MAX_SENDS]; voice->mDirect.Buffer = Device->Dry.Buffer; @@ -1292,7 +1292,7 @@ void CalcNonAttnSourceParams(Voice *voice, const VoiceProps *props, const Contex void CalcAttnSourceParams(Voice *voice, const VoiceProps *props, const ContextBase *context) { - const DeviceBase *Device{context->mDevice}; + DeviceBase *Device{context->mDevice}; const uint NumSends{Device->NumAuxSends}; /* Set mixing buffers and get send parameters. */ |