aboutsummaryrefslogtreecommitdiffstats
path: root/alc/voice.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2021-03-19 19:02:30 -0700
committerChris Robinson <[email protected]>2021-03-19 23:15:27 -0700
commit063da94bd8f4e2dc0369c283a7fa0f124764eb1c (patch)
tree974a8935401c8a04ff8619069002ac05bfe91320 /alc/voice.h
parentf7f29999601c7f4d0350fb43ceca8a5d84bc1432 (diff)
Load/convert samples from all channels at once for mixing
This uses a bit more memory (each voice needs to hold buffers for the deinterleaved samples of each channel, instead of just one buffer for the current channel being mixed on the device), but it will allow for handling formats that need or prefer their channels decoded together.
Diffstat (limited to 'alc/voice.h')
-rw-r--r--alc/voice.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/alc/voice.h b/alc/voice.h
index 4785fb6e..5921635c 100644
--- a/alc/voice.h
+++ b/alc/voice.h
@@ -213,9 +213,15 @@ struct Voice {
TargetData mDirect;
std::array<TargetData,MAX_SENDS> mSend;
- struct ChannelData {
- alignas(16) std::array<float,MaxResamplerPadding> mPrevSamples;
+ /* The first MaxResamplerPadding/2 elements are the sample history from the
+ * previous mix, with an additional MaxResamplerPadding/2 elements that are
+ * now current (which may be overwritten if the buffer data is still
+ * available).
+ */
+ using BufferLine = std::array<float,BufferLineSize+MaxResamplerPadding>;
+ al::vector<BufferLine,16> mVoiceSamples{2};
+ struct ChannelData {
float mAmbiScale;
BandSplitter mAmbiSplitter;