aboutsummaryrefslogtreecommitdiffstats
path: root/al
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-03-11 12:16:32 -0800
committerChris Robinson <[email protected]>2023-03-11 12:16:32 -0800
commit1e226fd54dc6670222ce1210cf55fe1b4d61e89c (patch)
treeb72c4cc990cdabcd0b4b475c57f809a1405bc329 /al
parent64ead7d36de7dc748414530121b69876a0c84e05 (diff)
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).
Diffstat (limited to 'al')
-rw-r--r--al/auxeffectslot.cpp4
-rw-r--r--al/source.cpp41
2 files changed, 9 insertions, 36 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;
}
}