From 1e226fd54dc6670222ce1210cf55fe1b4d61e89c Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 11 Mar 2023 12:16:32 -0800 Subject: Don't commit EAX updates in applyAllUpdates To avoid alcProcessContext causing deferred EAX properties to be committed. This simplifies updates when EAX has been initialized, but never or rarely used. Committing now always occurs in EAXSet when the property is non-deferred, updating the OpenAL object(s) with it (with OpenAL's updates then being applied based on the context's defer state). --- al/auxeffectslot.cpp | 4 ---- al/source.cpp | 41 +++++++++-------------------------------- 2 files changed, 9 insertions(+), 36 deletions(-) (limited to 'al') diff --git a/al/auxeffectslot.cpp b/al/auxeffectslot.cpp index 3e755569..dc6e1cfb 100644 --- a/al/auxeffectslot.cpp +++ b/al/auxeffectslot.cpp @@ -1013,10 +1013,6 @@ void ALeffectslot::updateProps(ALCcontext *context) void UpdateAllEffectSlotProps(ALCcontext *context) { std::lock_guard _{context->mEffectSlotLock}; -#ifdef ALSOFT_EAX - if(context->has_eax()) - context->eax_commit_fx_slots(); -#endif for(auto &sublist : context->mEffectSlotList) { uint64_t usemask{~sublist.FreeMask}; diff --git a/al/source.cpp b/al/source.cpp index eb45bf9c..f6358607 100644 --- a/al/source.cpp +++ b/al/source.cpp @@ -3919,41 +3919,18 @@ ALsource::~ALsource() void UpdateAllSourceProps(ALCcontext *context) { std::lock_guard _{context->mSourceLock}; -#ifdef ALSOFT_EAX - if(context->has_eax()) - { - /* If EAX is enabled, we need to go through and commit all sources' EAX - * changes, along with updating its voice, if any. - */ - for(auto &sublist : context->mSourceList) - { - uint64_t usemask{~sublist.FreeMask}; - while(usemask) - { - const int idx{al::countr_zero(usemask)}; - usemask &= ~(1_u64 << idx); - - ALsource *source{sublist.Sources + idx}; - source->eax_commit_and_update(); - } - } - } - else -#endif + auto voicelist = context->getVoicesSpan(); + ALuint vidx{0u}; + for(Voice *voice : voicelist) { - auto voicelist = context->getVoicesSpan(); - ALuint vidx{0u}; - for(Voice *voice : voicelist) + ALuint sid{voice->mSourceID.load(std::memory_order_acquire)}; + ALsource *source = sid ? LookupSource(context, sid) : nullptr; + if(source && source->VoiceIdx == vidx) { - ALuint sid{voice->mSourceID.load(std::memory_order_acquire)}; - ALsource *source = sid ? LookupSource(context, sid) : nullptr; - if(source && source->VoiceIdx == vidx) - { - if(std::exchange(source->mPropsDirty, false)) - UpdateSourceProps(source, voice, context); - } - ++vidx; + if(std::exchange(source->mPropsDirty, false)) + UpdateSourceProps(source, voice, context); } + ++vidx; } } -- cgit v1.2.3