[flutter_tools] support bundling SkSL shaders into Android applications#54499
[flutter_tools] support bundling SkSL shaders into Android applications#54499jonahwilliams wants to merge 10 commits intoflutter:masterfrom
Conversation
|
@jonahwilliams : for iOS, the tool may need to send an extra arg |
|
@liyuqian that seems counter productive, shouldn't we be encouraging users to move to metal? |
|
Yes, we encourage Metal. In the short term, however, we may not be able to bring Metal's performance on par with OpenGL on every aspect. So we could allow developers to choose based on their needs. If shader compilation jank is their blocker, then they probably would choose SkSL with OpenGL. If average rasterization performance is more important, they'd choose the default option with Metal without any SkSL warmup. Fixing the shader compilation jank on Metal needs our medium term solution "Test-based shader warmup #53609" to be implemented. |
|
@liyuqian I believe we discussed ways to validate this before by looking at the verbose logging, but I don't quite remember |
|
@jonahwilliams : add |
|
Ahh yeah, thats the one! |
|
I hit some issue with rebasing, so continuing here: https://github.com/jonahwilliams/flutter/pull/new/bundle_sksl_3 I'm not able to get the persistent cache to find the shader file. Interestingly looking through the logs from both flutter run and adb, I cannot see a place where setting the persistent cache directory gets logged: Specifically I'm looking for https://github.com/flutter/engine/blob/31ecf878aa1f12ee7f3a22c424673751db3100da/shell/common/persistent_cache.cc#L338 Logs: |
|
@jonahwilliams : thanks for discovering this issue! The root cause of this issue and its fix are described in flutter/engine#17948. Before that PR gets rolled, you can try your tools on iOS. |
|
FYI @jonahwilliams: I just found one more issue on Android so now I completely moved from reading files from a path to directly calling the AssetManager (flutter/engine#17948 (comment)). As a result, you no longer need to put the file in |
|
That works, thanks @liyuqian ! |
|
Success! |
|
Closing in favor of #56059 |
Description
Support bundling SkSL shaders into an android APK or appbundle via the
--bundle-sksl-pathcommand line options. If provided, these are validated for platform engine revision and then placed influtter_assets/sksl/io.flutter.shaders.jsonFixes #53115