Hacker News new | ask | show | jobs
by novok 1885 days ago
Funny enough there has been a long standing issue (as in years) with metal shaders that make the first minute or so of animations in flutter stuttery as the shaders compile.
1 comments

Presumably (asking out of curiosity, completely naive) there's no way to AOT compile them?
Kind of? But there seems to be a bunch of barriers in making it happen:

  SkSL warm-up doesn’t help newer iPhones using Metal.

  Flutter recently migrated from OpenGL to Metal for all newer iOS devices. (Please reference Metal on iOS FAQ on which iOS devices are considered new enough to use Metal.) However, Skia currently only implemented the SkSL warm-up for OpenGL. So the SkSL warm-up would only speed up older iOS devices by default. If you find shader compilation jank to be an issue for your app on newer iPhones, please let us know by filing a GitHub issue. In the longer term, we have a plan to use test-based shader warm-up to mitigate this. If there’s an urgent need for fixing shader compilation jank on newer iPhones, please leave feedback on Issue 61045, and we can help you turn on OpenGL for your app.
https://flutter.dev/docs/perf/rendering/shader

https://github.com/flutter/flutter/issues/61045

Two weeks ago on reddit "Shader precompilation for Metal has landed in Skia:" https://www.reddit.com/r/FlutterDev/comments/mq1ouu/advices_...

and comment from last week on a flutter issue say it's working for them on the master channel. https://github.com/flutter/flutter/issues/79298#issuecomment...

Other comments in other tickets said it might not be the complete solution, and it's not released on stable yet. I hope it works, but it might not.

It's also a bit indicative that this kind of issue is left standing for years. The desktop resize jank one similarly took years to resolve.