diff options
author | Chris Robinson <[email protected]> | 2021-01-21 02:05:55 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2021-01-21 04:03:30 -0800 |
commit | 20f5e7c1fafcd40cdee2f7226ae81480ae049d1a (patch) | |
tree | 3b7e1aef92cefcbea1b9fca7f472d4831c0322cb /alc/effects/convolution.cpp | |
parent | 92c653e5f0617befccf0bd44d035f821ec7cb1ba (diff) |
Avoid global constexpr arrays
Diffstat (limited to 'alc/effects/convolution.cpp')
-rw-r--r-- | alc/effects/convolution.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/alc/effects/convolution.cpp b/alc/effects/convolution.cpp index 4e10b62a..2dec0dc6 100644 --- a/alc/effects/convolution.cpp +++ b/alc/effects/convolution.cpp @@ -76,23 +76,23 @@ void LoadSamples(double *RESTRICT dst, const al::byte *src, const size_t srcstep } -auto GetAmbiScales(AmbiScaling scaletype) noexcept -> const std::array<float,MaxAmbiChannels>& +inline auto& GetAmbiScales(AmbiScaling scaletype) noexcept { - if(scaletype == AmbiScaling::FuMa) return AmbiScale::FromFuMa; - if(scaletype == AmbiScaling::SN3D) return AmbiScale::FromSN3D; - return AmbiScale::FromN3D; + if(scaletype == AmbiScaling::FuMa) return AmbiScale::FromFuMa(); + if(scaletype == AmbiScaling::SN3D) return AmbiScale::FromSN3D(); + return AmbiScale::FromN3D(); } -auto GetAmbiLayout(AmbiLayout layouttype) noexcept -> const std::array<uint8_t,MaxAmbiChannels>& +inline auto& GetAmbiLayout(AmbiLayout layouttype) noexcept { - if(layouttype == AmbiLayout::FuMa) return AmbiIndex::FromFuMa; - return AmbiIndex::FromACN; + if(layouttype == AmbiLayout::FuMa) return AmbiIndex::FromFuMa(); + return AmbiIndex::FromACN(); } -auto GetAmbi2DLayout(AmbiLayout layouttype) noexcept -> const std::array<uint8_t,MaxAmbi2DChannels>& +inline auto& GetAmbi2DLayout(AmbiLayout layouttype) noexcept { - if(layouttype == AmbiLayout::FuMa) return AmbiIndex::FromFuMa2D; - return AmbiIndex::FromACN2D; + if(layouttype == AmbiLayout::FuMa) return AmbiIndex::FromFuMa2D(); + return AmbiIndex::FromACN2D(); } @@ -387,7 +387,7 @@ void ConvolutionState::update(const ALCcontext *context, const EffectSlot *slot, } mOutTarget = target.Main->Buffer; - const auto &scales = GetAmbiScales(mAmbiScaling); + auto&& scales = GetAmbiScales(mAmbiScaling); const uint8_t *index_map{(mChannels == FmtBFormat2D) ? GetAmbi2DLayout(mAmbiLayout).data() : GetAmbiLayout(mAmbiLayout).data()}; |