aboutsummaryrefslogtreecommitdiffstats
path: root/al/auxeffectslot.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2021-04-19 05:10:49 -0700
committerChris Robinson <[email protected]>2021-04-19 05:10:49 -0700
commit4754c606023e2028be472e8246d659be49a469e5 (patch)
treee4f1e1ec2d71a052054873585338b1147fdaa2a9 /al/auxeffectslot.cpp
parentccb1355cc82fa964d951d8f8bb013e2040bfee89 (diff)
Don't flag the auxslot dirty when setting the current value
Diffstat (limited to 'al/auxeffectslot.cpp')
-rw-r--r--al/auxeffectslot.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/al/auxeffectslot.cpp b/al/auxeffectslot.cpp
index 7e12a070..150b346b 100644
--- a/al/auxeffectslot.cpp
+++ b/al/auxeffectslot.cpp
@@ -596,6 +596,8 @@ START_API_FUNC
if(!(value == AL_TRUE || value == AL_FALSE))
SETERR_RETURN(context, AL_INVALID_VALUE,,
"Effect slot auxiliary send auto out of range");
+ if UNLIKELY(slot->AuxSendAuto == !!value)
+ return;
slot->AuxSendAuto = !!value;
break;
@@ -603,6 +605,8 @@ START_API_FUNC
target = LookupEffectSlot(context.get(), static_cast<ALuint>(value));
if(value && !target)
SETERR_RETURN(context, AL_INVALID_VALUE,, "Invalid effect slot target ID");
+ if UNLIKELY(slot->Target == target)
+ return;
if(target)
{
ALeffectslot *checker{target};
@@ -637,6 +641,14 @@ START_API_FUNC
SETERR_RETURN(context, AL_INVALID_OPERATION,,
"Setting buffer on playing effect slot %u", slot->id);
+ if(ALbuffer *buffer{slot->Buffer})
+ {
+ if UNLIKELY(buffer->id == static_cast<ALuint>(value))
+ return;
+ }
+ else if UNLIKELY(value == 0)
+ return;
+
{
std::lock_guard<std::mutex> ___{device->BufferLock};
ALbuffer *buffer{};
@@ -720,6 +732,8 @@ START_API_FUNC
case AL_EFFECTSLOT_GAIN:
if(!(value >= 0.0f && value <= 1.0f))
SETERR_RETURN(context, AL_INVALID_VALUE,, "Effect slot gain out of range");
+ if UNLIKELY(slot->Gain == value)
+ return;
slot->Gain = value;
break;