-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Add offscreen texture checkerboarding #41199
Conversation
bd97b1a to
9056d73
Compare
|
I don't think it should be a property of a DL as you might want to render a DL with and without the effect. Making it a property of the Impeller and DlSkCanvas Dispatchers might be a better fit? DlSkCanvas might also want to support it for when we render directly to Skia. |
|
|
||
| namespace impeller { | ||
|
|
||
| using CheckerboardPipeline = |
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.
Can we conditionally include this shader in flutter runtime mode debug/profile mode only?
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.
+1. If we have a tons of these, we could also put them in a debug folder.
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.
chinmaygarde
left a comment
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.
Consider moving all the checkerboarding stuff into a separate debug options struct. Also, allowing the caller to control checkerboarding maybe something we don't want to do to make checkerboaring more useful in the future.
|
|
||
| namespace impeller { | ||
|
|
||
| using CheckerboardPipeline = |
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.
+1. If we have a tons of these, we could also put them in a debug folder.
impeller/aiks/canvas.cc
Outdated
|
|
||
| Canvas::Canvas() { | ||
| Canvas::Canvas() | ||
| : checkerboard_color_proc_([]() { |
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 is perhaps too configurable? Can we just make up this pattern ourselves? Or make this an implementation detail?
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.
I should clarify my thinking here. I was hoping to make the checkerboarding more useful by perhaps having nested save layers be rendered differently (via progressively darkening overlays maybe).
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.
Making the color non-configurable/just based on depth SGTM, but what about textures at the same depth? Maybe we can kick that can down the road, but it might make sense to make the edges of checkerboarded textures look distinct by rendering a solid border a few pixels wide.
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.
Also, should color remain consistent between frames?
It seems that hue should vary within a level, but darkness or opacity changes as you increase the level?
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.
I made the checkerboards red with 0.25 alpha + get progressively darker based on depth. At level >= 5 it's just black. I can add a little space division identifier in a follow-up and hue shift based on it -- this kind of thing will be useful for other tooling as well, and will be deterministic for multithreaded encoding.
impeller/aiks/canvas.cc
Outdated
| FML_DCHECK(base_pass_->GetSubpassesDepth() == 1u); | ||
| } | ||
|
|
||
| void Canvas::SetEnableOffscreenCheckerboard(bool enabled) { |
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.
We could have this and other debugging options separated into a debug options struct that can be assigned to the canvas.
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. PTAL at the new DebugOptions struct.
fb5b058 to
1919f03
Compare
jonahwilliams
left a comment
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!
chinmaygarde
left a comment
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.
I am not sure I followed Jims comment about this being a DL property. It doesn't seem to be.
d7088c9 to
c754aef
Compare
|
Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change). If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review. |
|
My new debug define isn't present when running the goldens. Gonna hold out on merging this until I work it out later. |
c754aef to
0d4cff8
Compare
3706424 to
74dda19
Compare
|
Oh, it's because the goldens run in release mode. I'll leave the test around, but this can't currently be verified with a golden. |
|
Golden file changes are available for triage from new commit, Click here to view. |
…124944) flutter/engine@da0805a...4a998b7 2023-04-16 [email protected] Roll Skia from cc3404330d3b to 03c8e529196d (1 revision) (flutter/engine#41255) 2023-04-16 [email protected] Roll Skia from 2d0b05335104 to cc3404330d3b (1 revision) (flutter/engine#41254) 2023-04-16 [email protected] Roll Fuchsia Linux SDK from hacWN-gQSoWudziIS... to 46T4ZTAt48yPRDEn5... (flutter/engine#41253) 2023-04-16 [email protected] Roll Fuchsia Mac SDK from gI2knJ4Rh0yoK4Syd... to AAx6fLy6ykWVhXvNh... (flutter/engine#41252) 2023-04-16 [email protected] [Impeller] Add offscreen texture checkerboarding (flutter/engine#41199) Also rolling transitive DEPS: fuchsia/sdk/core/linux-amd64 from hacWN-gQSoWu to 46T4ZTAt48yP fuchsia/sdk/core/mac-amd64 from gI2knJ4Rh0yo to AAx6fLy6ykWV If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#124944) flutter/engine@da0805a...4a998b7 2023-04-16 [email protected] Roll Skia from cc3404330d3b to 03c8e529196d (1 revision) (flutter/engine#41255) 2023-04-16 [email protected] Roll Skia from 2d0b05335104 to cc3404330d3b (1 revision) (flutter/engine#41254) 2023-04-16 [email protected] Roll Fuchsia Linux SDK from hacWN-gQSoWudziIS... to 46T4ZTAt48yPRDEn5... (flutter/engine#41253) 2023-04-16 [email protected] Roll Fuchsia Mac SDK from gI2knJ4Rh0yoK4Syd... to AAx6fLy6ykWVhXvNh... (flutter/engine#41252) 2023-04-16 [email protected] [Impeller] Add offscreen texture checkerboarding (flutter/engine#41199) Also rolling transitive DEPS: fuchsia/sdk/core/linux-amd64 from hacWN-gQSoWu to 46T4ZTAt48yP fuchsia/sdk/core/mac-amd64 from gI2knJ4Rh0yo to AAx6fLy6ykWV If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Part of: flutter/flutter#124819.
Adds an offscreen texture checkerboarding feature with an overridable color picker. By default, it should look the same as our current checkerboarding for Skia. It can be turned on/off at any time while recording commands.
For hooking this up with the framework, we could either snake a global setting through to the context, or sneak it in through the DL as, say, a scoped SaveLayer option.
Video of checkerboards getting rendered to offscreen textures only:
Screen.Recording.2023-04-14.at.12.29.55.AM.mov
New golden:
