Bug 231314 - Cache PannerNode's azimuth, elevation and coneGain
Summary: Cache PannerNode's azimuth, elevation and coneGain
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Audio (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-10-06 11:15 PDT by Chris Dumez
Modified: 2021-10-07 13:39 PDT (History)
10 users (show)

See Also:


Attachments
Patch (20.69 KB, patch)
2021-10-06 11:21 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (20.69 KB, patch)
2021-10-06 17:53 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2021-10-06 11:15:26 PDT
Cache PannerNode's azimuth, elevation and coneGain for better performance. I have noticed while profiling https://downloads.scirra.com/labs/bugs/safaripannerquality/ that PannerNode::process() spends most of its CPU time under PannerNode::calculateAzimuthElevation(). We shouldn't have to re-calculate those properties for every rendering quantum.
Comment 1 Chris Dumez 2021-10-06 11:21:55 PDT
Created attachment 440393 [details]
Patch
Comment 2 Geoffrey Garen 2021-10-06 16:31:37 PDT
Comment on attachment 440393 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=440393&action=review

> Source/WebCore/Modules/webaudio/AudioListener.cpp:126
> +void AudioListener::updateDirtyState()

I must be missing something, but it seems like this function says "if nothing has changed, then we are dirty", which is opposite how I usually understand the phrase "dirty" in rendering. What am I missing?
Comment 3 Chris Dumez 2021-10-06 16:33:17 PDT
Comment on attachment 440393 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=440393&action=review

>> Source/WebCore/Modules/webaudio/AudioListener.cpp:126
>> +void AudioListener::updateDirtyState()
> 
> I must be missing something, but it seems like this function says "if nothing has changed, then we are dirty", which is opposite how I usually understand the phrase "dirty" in rendering. What am I missing?

Uh? I think I messed things up with a last minute patch clean up before uploading. I agree this looks backwards now.
Comment 4 Chris Dumez 2021-10-06 17:53:14 PDT
Created attachment 440461 [details]
Patch
Comment 5 Chris Dumez 2021-10-06 18:17:42 PDT
The cache is being leveraged by imported/w3c/web-platform-tests/webaudio/the-audio-api/the-pannernode-interface/panner-rolloff-clamping.html
Comment 6 Eric Carlson 2021-10-07 13:30:50 PDT
Comment on attachment 440461 [details]
Patch

r=me
Comment 7 EWS 2021-10-07 13:36:39 PDT
Committed r283740 (242662@main): <https://commits.webkit.org/242662@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 440461 [details].
Comment 8 Radar WebKit Bug Importer 2021-10-07 13:39:46 PDT
<rdar://problem/83996910>