diff options
-rw-r--r-- | al/auxeffectslot.cpp | 4 | ||||
-rw-r--r-- | al/source.cpp | 41 | ||||
-rw-r--r-- | alc/context.cpp | 16 |
3 files changed, 17 insertions, 44 deletions
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<std::mutex> _{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<std::mutex> _{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; } } diff --git a/alc/context.cpp b/alc/context.cpp index cff666e8..16acb0e8 100644 --- a/alc/context.cpp +++ b/alc/context.cpp @@ -264,10 +264,6 @@ void ALCcontext::applyAllUpdates() /* busy-wait */ } -#ifdef ALSOFT_EAX - if(eax_is_initialized_) - eax_commit(); -#endif if(std::exchange(mPropsDirty, false)) UpdateContextProps(this); UpdateAllEffectSlotProps(this); @@ -353,8 +349,12 @@ ALenum ALCcontext::eax_eax_set( eax_fail_unknown_property_set_id(); } - if(!call.is_deferred() && !mDeferUpdates) - applyAllUpdates(); + if(!call.is_deferred()) + { + eax_commit(); + if(!mDeferUpdates) + applyAllUpdates(); + } return AL_NO_ERROR; } @@ -1002,8 +1002,6 @@ void ALCcontext::eax_context_commit() case 5: eax5_context_commit(eax5_, dst_df); break; - default: - eax_fail_unknown_version(); } if(dst_df == EaxDirtyFlags{}) @@ -1031,6 +1029,8 @@ void ALCcontext::eax_context_commit() void ALCcontext::eax_commit() { eax_context_commit(); + eax_commit_fx_slots(); + eax_update_sources(); } namespace { |