-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Implement RuntimeEffectContents #36866
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (but not to CI)
@@ -426,7 +430,26 @@ void DisplayListDispatcher::setColorSource( | |||
return; | |||
} | |||
case flutter::DlColorSourceType::kConicalGradient: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this still be UNIMPLEMENTED
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, fixed.
auto uniform_data_sk = runtime_effect_color_source->uniform_data(); | ||
|
||
paint_.color_source = [runtime_stage, uniform_data_sk]() { | ||
// TODO(bdero): Get rid of the allocation + copy for uniform data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please file an issue for this TODO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done: flutter/flutter#113714
std::promise<bool> promise; | ||
auto future = promise.get_future(); | ||
|
||
library->RegisterFunction( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we be doing this immediately after reading the shader in from the asset?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but I'd like to defer figuring out the threading and g3 dependency situation to a later patch. I assume we're already building all of Impeller though, so maybe g3 isn't as much a concern.
Added an issue: flutter/flutter#113719
|
||
size_t buffer_index = 0; | ||
for (auto uniform : runtime_stage_->GetUniforms()) { | ||
// TODO(bdero): Populate this metadata once GLES is able to handle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please file (or update) an issue for this TODO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done: flutter/flutter#113715
impeller/entity/entity_unittests.cc
Outdated
// vec3 col = 0.5 + 0.5*cos(t + uv.xyx + vec3(0,1,4)); | ||
// fragColor = vec4(col,1.0); | ||
// } | ||
auto runtime_stage = LoadFixtureRuntimeStage("example.frag.metal.iplr"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't need to be checked in. It can be generated by the build. We do that for ink_sparkle here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm when tests pass.
f5a1cb4
to
3310ce8
Compare
Video of the example app in Impeller: PXL_20221019_225320731.mp4There's some weirdness happening with the Skia backend where it seems to stop redrawing and flips back and forth between two frames on iOS unless a redraw is triggered through alternative means. This only happens on iOS and this behavior predates my patches: PXL_20221019_230419973.mp4 |
…113766) * 7d18d7007 [Impeller] Support external textures on iOS (flutter/engine#36498) * d07919654 [Impeller] Implement RuntimeEffectContents (flutter/engine#36866) * 119e839ef Revert "[Impeller] Implement RuntimeEffectContents (#36866)" (flutter/engine#36883) * bcd83df4e [Impeller] Reland RuntimeEffectContents (flutter/engine#36884)
This gets Runtime Effects with uniform buffer bindings running in Impeller.
Part of flutter/flutter#102853.
Up next: