Currently, the eventInstance != mEventInstance check always returns true, causing mFoundDSP to be set to false for every emitter, each frame.
As a result FindDSP() runs past the guard clause for every emitter in the main Update() loop. This creates kBs worth of garbage and performance losses with just a handful of audio sources.
Observed in Unity 2022.3.4f1, FMOD 2.01.07, and both Steam Audio 4.1.2 and 4.5.3
After changing eventInstance != mEventInstance to !eventInstance.Equals(mEventInstance), mFoundDSP remains true until either the fmodEventEmitter changes, or the underlying fmodEventInstance changes (which I assume is the intended behavior).
Tested in Unity 2022.3.4f1, FMOD 2.01.07, and Steam Audio 4.5.3
Currently, the
eventInstance != mEventInstance
check always returns true, causingmFoundDSP
to be set to false for every emitter, each frame. As a resultFindDSP()
runs past the guard clause for every emitter in the mainUpdate()
loop. This creates kBs worth of garbage and performance losses with just a handful of audio sources.Observed in Unity 2022.3.4f1, FMOD 2.01.07, and both Steam Audio 4.1.2 and 4.5.3
After changing
eventInstance != mEventInstance
to!eventInstance.Equals(mEventInstance)
,mFoundDSP
remains true until either the fmodEventEmitter changes, or the underlying fmodEventInstance changes (which I assume is the intended behavior).Tested in Unity 2022.3.4f1, FMOD 2.01.07, and Steam Audio 4.5.3