Add a dart:ui-internal flag to check if impeller is enabled#33040
Add a dart:ui-internal flag to check if impeller is enabled#33040zanderso merged 1 commit intoflutter:mainfrom
Conversation
dnfield
left a comment
There was a problem hiding this comment.
I'd like to understand what the FragmentProgram API will look like. Is there a doc or a PR?
For example, I imagine that FragmentProgram.compile will get deprecated, and that if it doesn't already we want it to check for the right SPIR-V magic number. With impeller, it will throw an exception telling the developer to instead use FragmentProgram.fromAsset fromBytes or something.
It seems like it would be strange to me to continue to use an api called FragmentProgram.compile on a shader that's already compiled.
|
Yeah, good point. I hadn't yet gotten to the point of thinking about what the API should look like, but making it more backend-agnostic might involve e.g. renaming |
Part of flutter/flutter#102853
dart:uiinternals will need to know whether the Engine is using Impeller so that it knows what to do with the binary blob for a shader. If the Engine is using Skia, the blob is spir-v and has to be transpiled to SkSL. If the Engine is using Impeller, then the blob can be handled directly.