Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@zanderso
Copy link
Member

@zanderso zanderso commented May 1, 2022

Part of flutter/flutter#102853

dart:ui internals 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.

@zanderso zanderso requested review from chinmaygarde and dnfield May 1, 2022 22:33
Copy link
Contributor

@dnfield dnfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@zanderso
Copy link
Member Author

zanderso commented May 2, 2022

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 compile to prepare or something like that. I suspect we might still want some opportunity for async setup on some backends even after we already have the data loaded form an asset. Not sure what web is going to need, for example. If we don't need additional async setup, prepare can just be a no-op. Let's chat more at the Wednesday meeting.

@zanderso zanderso merged commit f2d7165 into flutter:main May 3, 2022
@zanderso zanderso deleted the add-internal-impeller-flag branch May 3, 2022 18:27
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants