| Summary: | REGRESSION (iOS 15): Fragment shader performance is several times worse | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Brian Richardson <brichardson> |
| Component: | WebGL | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW --- | ||
| Severity: | Normal | CC: | 3dsrdlab, dino, kbr, kkinnunen, kpiddington, sebastien.videcoq, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | All | ||
| OS: | Unspecified | ||
| Bug Depends on: | |||
| Bug Blocks: | 231180 | ||
| Attachments: | |||
|
Description
Brian Richardson
2021-10-25 14:28:16 PDT
Thank you for the report. If you have time, a test case where three.js and the payload app code is unbundled and both are not minified would be most useful. I can reproduce the issue. Reproduces also on macOS, AMD. The GPU work increases very much when using ANGLE Metal backend. Hello Kimmo: Thanks for taking the time to look into this. I've updated the example to use just vanilla HTML/JS and an external version of Three.JS. I hope that makes things easier! (In reply to Brian Richardson from comment #2) > Hello Kimmo: > > Thanks for taking the time to look into this. I've updated the example to > use just vanilla HTML/JS and an external version of Three.JS. I hope that > makes things easier! Thanks! The update does not seem to work on Safari? "[Error] TypeError: Module specifier, 'three' does not start with "/", "./", or "../". Referenced from https://depot.knowhere.net/ios15regression/?num=5 promiseReactionJob" (It does work on Chrome, though..) (In reply to Kimmo Kinnunen from comment #4) > The update does not seem to work on Safari? Fixed. I thought it'd be a fun time to try import maps, I guess when I tested on my phone it was using a cached version. Removed that and it works in Safari for me! Created attachment 442606 [details]
Test case showing the issue. If you run with /?num=6 you'll see the perf cliff vs /?num=5
Hello, any progress on this bug ? It deeply impacts our product, FPS has dropped from 60 to 2 FPS. Adding another test sample that illustrate the behavior. Thanks in advance. Created attachment 445098 [details]
another test case
Sébastien: In our case, manually unrolling the loop seems to work around the issue. Give it a shot! Hope that helps! Brian Brian, thanks a lot for the advice, we already gave a quick try this afternoon, but we are far from getting back performances of iOS 14. Maybe we are now facing another iOS 15 regression ? We will try again tomorrow and provide feedbacks. Hi all! Some updates for you. Apologies for the delay. We've identified the main issue here. Part of our shader transformation passes tries it's best to preserve the original GLSL struct while following Metal alignment best practices. What this means for the attached shaders is that we're promoting the vec3 uniforms to vec4 for sending over as uniform data, but are then converting back to vec3 in the MSL shader. This temporary variable is able to be stored in shader registers, up until the arrays get too big. We'll have a fix in on our end, but if you need faster performance in the meantime, try changing your vec3 variables to vec4. Created attachment 449452 [details]
Workaround demonstrating how uniform data type affects performance
|