WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
ASSIGNED
222731
WebGL2: Slow instanced rendering performance.
https://bugs.webkit.org/show_bug.cgi?id=222731
Summary
WebGL2: Slow instanced rendering performance.
Michael Herzog
Reported
2021-03-04 03:16:14 PST
I have enabled WebGL 2 in Safari Technology Preview Release 121 (Safari 14.2, WebKit 15612.1.4.3) on macOS 10.15.7. I'm now testing the official three.js examples with Safari's WebGL 2 implementation and encountered a performance problem with this demo:
https://threejs.org/examples/webgl_instancing_raycast
It runs at 60 FPS on my iMac when WebGL 2 is disabled. But when enabling it, I only get 1 FPS. The demo runs in latest Chrome and Firefox on the same system with WebGL 2 at 60 FPS. There are no warnings/errors in Safari's browser console. Besides, I get the same performance issue with stable Safari 14.0 when enabling WebGL 2.
Attachments
Add attachment
proposed patch, testcase, etc.
Kenneth Russell
Comment 1
2021-03-04 19:29:00 PST
Kimmo, do you have the hardware to reproduce this? This runs fine on my 2017 15" MacBook Pro with dual Intel HD 630 and AMD Radeon 560 GPUs. Kyle, I wonder whether this will automatically be solved with ANGLE's Metal backend.
Kimmo Kinnunen
Comment 2
2021-03-04 23:18:51 PST
Thanks for the report I can repro this on MacBook16,1 Intel 630, AMD 5500M Appears to repro with either GPU Cannot repro this on iMac1,1. Symptoms: - The FPS counter is saying 60fps. - The system is very laggy. - The rendering is very slow. - No out of ordinary CPU usage in Activity Monitor
Radar WebKit Bug Importer
Comment 3
2021-03-04 23:19:23 PST
<
rdar://problem/75080718
>
Kimmo Kinnunen
Comment 4
2021-03-05 00:44:37 PST
Ok, now I don't know how I reproduced the issue -- I cannot reproduce it exactly anymore. (I'm not sure if I ran a debug build?) Current observations: On MacBookPro2019,1, Intel 630, AMD 5500M, Big Sur: Chrome Canary can open the site in multiple windows, maintain responsive system and it says 60FPS. (Using multiple app instances, so multiple GPU processes.) Safari with WebGL2 can open one window and maintain 60FPS. Safari with WebGL2 and multiple windows, it says sometimes 60 or high-40 FPS but makes the whole system very laggy. Safari with WebGL1 can open one window and mainatain 60FPS. Safari with WebGL1 and multiple windows, system seems responsive than with WebGL2, but less responsive than Chrome Michael Herzog: what kind of model is your iMac? Could you click on the Apple menu, About this Mac and report the model.
Michael Herzog
Comment 5
2021-03-05 01:30:30 PST
iMac (Retina 5K, 27'', ultimo 2014) 4 GHz Quad-Core Intel Core i7 16 GB 1600 MHz DDR3 AMD Radeon R9 M295X 4 GB
Kenneth Russell
Comment 6
2021-03-05 21:01:25 PST
Hmm. I haven't looked into this but one thing Chrome had to do years ago was throttle its rendering on macOS by explicitly waiting on a fence issued a couple or few frames earlier. The problem was specifically that on some GPUs, rendering was so asynchronous in macOS that the application could easily submit many frames of GPU-heavy work, and once that happened, the entire system would slow to a crawl. Maybe a similar mechanism needs to be added to WebKit.
Kimmo Kinnunen
Comment 7
2021-03-08 00:46:10 PST
Other observation: The rendering is slow on Safari when the element being color-cycled is covering large part of the screen. Does not happen on Chrome.
Kimmo Kinnunen
Comment 8
2021-04-13 03:27:12 PDT
The enablement of ANGLE Metal backend on Mac seems to fix the immediate performance issue here.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug