diff options
author | Chris Robinson <[email protected]> | 2022-03-05 01:14:26 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-03-05 01:14:26 -0800 |
commit | 2dc9cf170c08f0b7f35ec46cb17c829888e7392c (patch) | |
tree | 76865c75ba9cd0dce3452988ff28ac7636a82872 /alc/context.cpp | |
parent | 7bec22abb61fa1b87e157dd6b577ba174d3273d3 (diff) |
Simplify committing EAX properties
Based on DirectSound's EAX behavior, committing any EAX property commits *all*
deferred property changes, not just the object being changed. So applying EAX
changes can be handled in one place.
Diffstat (limited to 'alc/context.cpp')
-rw-r--r-- | alc/context.cpp | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/alc/context.cpp b/alc/context.cpp index 5a24a311..4b1c2a4c 100644 --- a/alc/context.cpp +++ b/alc/context.cpp @@ -332,11 +332,10 @@ ALenum ALCcontext::eax_eax_set( { eax_initialize(); - constexpr auto deferred_flag = 0x80000000u; const auto eax_call = create_eax_call( false, property_set_id, - property_id | (mDeferUpdates ? deferred_flag : 0u), + property_id, property_source_id, property_value, property_value_size @@ -363,6 +362,10 @@ ALenum ALCcontext::eax_eax_set( eax_fail("Unsupported property set id."); } + static constexpr auto deferred_flag = 0x80000000u; + if(!(property_id&deferred_flag) && !mDeferUpdates) + applyAllUpdates(); + return AL_NO_ERROR; } @@ -1136,22 +1139,6 @@ void ALCcontext::eax_set( default: eax_fail("Unsupported property id."); } - - if(!eax_call.is_deferred()) - { - eax_apply_deferred(); - - mHoldUpdates.store(true, std::memory_order_release); - while((mUpdateCount.load(std::memory_order_acquire)&1) != 0) { - /* busy-wait */ - } - - if(std::exchange(mPropsDirty, false)) - UpdateContextProps(this); - UpdateAllSourceProps(this); - - mHoldUpdates.store(false, std::memory_order_release); - } } void ALCcontext::eax_apply_deferred() |