diff options
author | Chris Robinson <[email protected]> | 2020-11-02 04:24:36 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-11-02 04:24:36 -0800 |
commit | 52d58a40234b8829801f0a587375eca91694c30f (patch) | |
tree | caa8d283de74feeb4f23eab39ea57b3835c3bffc /al | |
parent | 6e05adf955bdd81c82a1feabb25f6f27d7bc56e0 (diff) |
Store the wet buffers in the context
This is rather ugly, but we need the wet buffers to remain allocated after its
effect slot is deleted, because a voice can still use it for its final fade-out
mix.
Diffstat (limited to 'al')
-rw-r--r-- | al/auxeffectslot.cpp | 4 | ||||
-rw-r--r-- | al/auxeffectslot.h | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/al/auxeffectslot.cpp b/al/auxeffectslot.cpp index 74005aaa..df04f430 100644 --- a/al/auxeffectslot.cpp +++ b/al/auxeffectslot.cpp @@ -216,7 +216,7 @@ ALeffectslot *AllocEffectSlot(ALCcontext *context) context->setError(err, "Effect slot object initialization failed"); return nullptr; } - aluInitEffectPanning(slot, context->mDevice.get()); + aluInitEffectPanning(slot, context); /* Add 1 to avoid source ID 0. */ slot->id = ((lidx<<6) | slidx) + 1; @@ -822,6 +822,8 @@ ALeffectslot::~ALeffectslot() delete props; } + if(mWetBuffer) + mWetBuffer->mInUse = false; if(Params.mEffectState) Params.mEffectState->release(); } diff --git a/al/auxeffectslot.h b/al/auxeffectslot.h index fdab99ef..03ba034a 100644 --- a/al/auxeffectslot.h +++ b/al/auxeffectslot.h @@ -18,6 +18,7 @@ struct ALbuffer; struct ALeffect; struct ALeffectslot; +struct WetBuffer; using ALeffectslotArray = al::FlexArray<ALeffectslot*>; @@ -87,7 +88,7 @@ struct ALeffectslot { ALuint id{}; /* Mixing buffer used by the Wet mix. */ - al::vector<FloatBufferLine, 16> MixBuffer; + WetBuffer *mWetBuffer{nullptr}; /* Wet buffer configuration is ACN channel order with N3D scaling. * Consequently, effects that only want to work with mono input can use |