Bug 218949
Summary: | WebGL instanced draw calls are very slow on iPhone 12 Pro | ||
---|---|---|---|
Product: | WebKit | Reporter: | Akihiko Kusanagi <nagi> |
Component: | WebGL | Assignee: | Kimmo Kinnunen <kkinnunen> |
Status: | RESOLVED FIXED | ||
Severity: | Major | CC: | dino, frank, gary, geofflang, jdarpinian, jhurliman, jonahr, kbr, kkinnunen, kpiddington, lasse, msokalski, ppicachu, stevebriscoe123, webkit-bug-importer, wg-3d-iphone-12-pefor-aaaaddel322apcnrrpy4bofp3i |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari 14 | ||
Hardware: | iPhone / iPad | ||
OS: | Other | ||
Bug Depends on: | 220896 | ||
Bug Blocks: | 223434 |
Akihiko Kusanagi
WebGL instanced draw calls are very slow in any browser on iPhone 12 Pro. There is no performance issue in the same browser/OS versions on my old iPhone 8 Plus. Initially I noticed this in deck.gl code, but later realized that this issue is not deck.gl specific as a simple three.js program that uses instanced draw calls has the same issue.
How to reproduce:
- Instancing example (https://cdn.rawgit.com/pailhead/three.js/instancing-part2/examples/webgl_interactive_cubes.html) in this article: https://medium.com/@pailhead011/instancing-with-three-js-part-2-3be34ae83c57
- Deck.gl examples (GeoJsonLayer(Polygons), GeoJsonLayer(Paths), ...) in this page: https://deck.gl/examples
Environment:
- Browser: Safari 14, Chrome (for iOS) 86.0.4240.93 and FireFox (for iOS) 29.1
- OS: iOS 14.1 and 14.2
- Device: iPhone 12 Pro
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/71408222>
Kenneth Russell
Hmm, that's interesting. Certainly unrelated, but coincidentally, there was an instancing performance regression in Qualcomm's Adreno driver in Android R: http://crbug.com/1123700 . It was fixed in a subsequent driver release.
Kimmo or Dean, can either of you confirm whether this is a regression from the switch to ANGLE? Or is it hardware-specific and unrelated to ANGLE?
Kimmo Kinnunen
Thanks for the report!
https://threejs.org/examples/webgl_interactive_cubes.html
iPhone Xr iOS 14.2 60fps
iPhone 12 iOS 14.2 18fps
It appears to be HW-specific regression.
Kenneth Russell
Thanks for confirming Kimmo. Can this performance regression be reported to Apple's OpenGL ES driver team?
Raising to Major severity - in recent years most WebGL applications have transitioned to using instanced draw calls to achieve better scaling, and this regression will adversely affect the entire ecosystem.
Kimmo, could you perhaps track progress of this report through Apple's internal bug tracker?
Akihiko Kusanagi
Is there any update on this issue?
Toni MartÃ
Ping! How it's going with this issue?
Akihiko Kusanagi
I still see this regression on iOS 14.4.
Akihiko Kusanagi
This performance regression is seen on all A14 Bionic devices.
Marcin
I can't reproduce it on iPad Air 2020 (A14 Bionic) with iPadOS 14.4.1
Repro case https://threejs.org/examples/webgl_interactive_cubes.html runs easily at 60fps
Akihiko Kusanagi
> I can't reproduce it on iPad Air 2020 (A14 Bionic) with iPadOS 14.4.1
>
> Repro case https://threejs.org/examples/webgl_interactive_cubes.html runs easily at 60fps
It's the original three.js example which runs with no problem. I see a performance regression in https://cdn.rawgit.com/pailhead/three.js/instancing-part2/examples/webgl_interactive_cubes.html, the instancing version of it.
Marcin
Confirmed, https://cdn.rawgit.com/pailhead/three.js/instancing-part2/examples/webgl_interactive_cubes.html
runs 18fps on iPad Air 2020, iPadOS 14.4.1
Gary Herman
We are also seeing significant performance issues in our WebGL application at https://human.biodigital.com on these devices. Has Apple acknowledged this issue? As more people get iPhone 12 we are seeing an increase in the number of complaints from our users.
Frank Sculli
Here are two videos clearly showing the regression in FPS going from the iPhone 11 to the same 3D graphics running on the iPhone 12.
iPhone 11
https://human.biodigital.com/tmp/rpreplay_final1617998863.mp4
iPhone 12
https://human.biodigital.com/tmp/rpreplay_final1617998786.mp4
And a link to the same model if you would like to try it:
https://human.biodigital.com/viewer/?be=4Ima&ui-info=true&ui-search=true&ui-undo=true&ui-fullscreen=true&ui-nav=true&ui-tools=true&ui-help=true&ui-chapter-list=false&ui-label-list=true&ui-anatomy-descriptions=false&ui-tutorial=false&ui-loader=circle&ui-whiteboard=true&ui-layers=true&ui-anatomy-labels=true&disable-scroll=false&dk=4b331fad5eef5d6a1677a2d5fa1f7c373cbba0be&load-rotate=6
@Kimmo do you know if Apple is looking into this?
thanks!
Kimmo Kinnunen
The enablement of ANGLE Metal backend on iPhone seems to fix the immediate performance issue here.
Kenneth Russell
To the reporters: we're collaborating as quickly as possible to shake out the bugs from ANGLE's Metal backend that Apple's made tremendous improvements to. That sounds like it will be the fastest resolution to this device-specific performance issue.
Lasse Laakkonen
This https://cdn.rawgit.com/pailhead/three.js/instancing-part2/examples/webgl_interactive_cubes.html should probably not be used for any testing, it seems to be running ThreeJS revision "97dev" from 2018: https://github.com/mrdoob/three.js/releases?after=r98
Also:
Assuming that the issue is on all devices with A14 Bionic chips.
1. Since Kimmo was able to reproduce the issue on 2020-11-16 in https://threejs.org/examples/webgl_interactive_cubes.html using an iPhone 12 and now the issue can not be reproduced on that page with a iPad Air 4th gen 2020, it would mean that issue would have been fixed in Three.js?
2. Since for example all of these work at FPS 60 on an iPad Air 4th gen 2020, Three.js has fixed / worked around the issue somehow?
- https://threejs.org/examples/webgl_interactive_cubes.html
- https://threejs.org/examples/#webgl_instancing_dynamic
- https://threejs.org/examples/#webgl_instancing_performance
- https://threejs.org/examples/#webgl_instancing_raycast
- https://threejs.org/examples/#webgl_instancing_scatter
Akihiko Kusanagi
I replaced three.js in https://cdn.rawgit.com/pailhead/three.js/instancing-part2/examples/webgl_interactive_cubes.html with the latest version (r127), but FPS is still around 18. See the codepen:
https://codepen.io/nagixx/full/RwKJRQy
Steven Briscoe
Is there any movement on this issue? I'm facing this same issue and we have customers complaining due to the performance being really bad. All other iOS devices seem unaffected but the iPhone 12 seems particularly bad.
This seems to be the same issue here: https://github.com/visgl/deck.gl/issues/5101
Appreciate the help!
Steve
Steven Briscoe
(In reply to Steven Briscoe from comment #18)
> Is there any movement on this issue? I'm facing this same issue and we have
> customers complaining due to the performance being really bad. All other iOS
> devices seem unaffected but the iPhone 12 seems particularly bad.
>
> This seems to be the same issue here:
> https://github.com/visgl/deck.gl/issues/5101
>
> Appreciate the help!
> Steve
Quick edit: I've also been told that iOS 14.6 does not address this issue.
Frank Sculli
Following up on Steve's comment above, as more people have the iPhone 12 we are now receiving a ton of complaints.
Is it possible to provide some insight into the status of this fix? Much appreciated!
Akihiko Kusanagi
Today I updated my iPhone 12 Pro to iOS 15, and I confirmed that this instancing performance issue was fixed! At least, my application and deck.gl examples all work smoothly, so I set this bug to RESOLVED.