-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Enable depth buffer clipping & Stencil-then-Cover path rendering. #50856
Conversation
impeller/entity/entity_unittests.cc
Outdated
EXPECT_TRUE(contains_size(ISize(1000, 1000))) | ||
<< "The root texture wasn't allocated"; | ||
EXPECT_TRUE(contains_size(ISize(200, 200))) | ||
<< "The ColorBurned texture wasn't allocated (100x100 scales up 2x)"; |
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 test was fragile so I tried to encode its intent better rather than adding more branches.
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.
SGTM
cf403fd
to
39d0f4a
Compare
default: | ||
FML_UNREACHABLE(); | ||
} | ||
pass.SetPipeline(renderer.GetClipPipeline(options)); |
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 had to rework this StC logic a bit because it wasn't handling Positions+UVs right. I was inadvertently stenciling with position+UV geometry (bad) and then covering using a position-only rectangle (also bad).
This is fixed now. When we need to use StC, we only generate positions for the stencil prep draw and then draw the cover rectangle with or without UVs as necessary.
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 have a preference towards separating out this rework and the flag-flip of the stencil-then-cover into separate PRs.
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.
Agreed, I pulled out these changes into this PR: #50900
Can you separate just the flag flip into another PR? Otherwise lgtm. |
d63d870
to
2889d04
Compare
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 after #50900 lands. So a lot of this go away with just the flag flip remaining. Thanks!
The accumulated fixes pulled out of the flag flip PR: #50856 * Also fixes tests to make them resilient to StC being on/off. * Fix blending for the cover draw. * Default to depth=1 which is much more reasonable as depth=0 will never draw anything for cover draws. This allows enclosed subpass rendering cases like `Contents::RenderToSnapshot` for filter inputs to work by default and makes mistakes harder. * Use depth+stencil attachments for `Contents::RenderToSnapshot` subpasses to allow for StC draws.
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)
The failing test: "Canvas.drawParagraph " IIRC is using Picture.toImage and the Vulkan swiftshader backend, fwiw |
2889d04
to
ab75373
Compare
There's something funky going on here. On |
2830572
to
ab75373
Compare
Okay, so it only ever fails when |
In total I've seen these tests failing on and off so far:
All of these are doing On macos, I can only repro the |
I started dumping the result images before performing the failing ByteData comparison. Formatting the |
If I add Peculiar! Maybe an underlying allocation is being prematurely freed or reused. |
If I disable the DeviceBuffer VMA pool by commenting out these lines the buffers stop getting corrupted: engine/impeller/renderer/backend/vulkan/allocator_vk.cc Lines 459 to 461 in 1d7d5e6
|
I'm not sure how the multi threaded test env. Works, but it's possible that it is breaking some contracts about thread safety of the contexts. You might try backing out Aaron's change to reuse the context objects in the test environment |
Oh wait, but then that wouldn't explain tester changes. |
Well if it makes it work, id say delete the VMAPool. But I'm a bit suspicious that something in the flutter tester integration is busted |
I'm sort of wondering if there is a problem with the readback implementation in image_encoding_impeller.cc -> ConvertBufferToSkImage. We blit the render target texture into a device buffer and then readback that device buffer. Potentially the device buffer is getting released too early, or we're missing a memory barrier for the readback. I'm not sure if the fence waiter firing guarantees that the buffer is fully populated. |
I opened two PRs with adjustments to buffer usage/readback to see if those pass/fail |
I think the "do everything plus barrier" pr is working but is hitting a GLES exception |
You gotta stop force pushing! |
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, please land a non-force pushed commit so we can verify gold.
Golden file changes are available for triage from new commit, Click here to view. |
My understanding is that this bug is limited to the flutter-engine-gold.skia.org interface. The |
these goldens look unexpected. Did you need the change from #51101 ? |
Maybe. Let's try just the picture.cc attachment change. |
Yup that seems to work. Want to land your patch @jonahwilliams? The brand new blur style is broken with StC so now I'm trying to chase that down now. |
Golden file changes are available for triage from new commit, Click here to view. |
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
…144607) flutter/engine@d514a30...17a4b66 2024-03-05 [email protected] Roll Skia from a577399ed6fb to 5839a94bf28b (1 revision) (flutter/engine#51194) 2024-03-05 [email protected] [Impeller] Turn off StC. (flutter/engine#51191) 2024-03-05 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Reland: [macOS] Use CVDisplayLink to drive repaint (#51126)" (flutter/engine#51192) 2024-03-05 [email protected] Roll Skia from 9c62e7b382cf to a577399ed6fb (1 revision) (flutter/engine#51190) 2024-03-05 [email protected] Reland "Remove migration flag and unused header files #50216" (flutter/engine#50259) 2024-03-05 [email protected] Shift git version fetching to tools/gn (flutter/engine#51175) 2024-03-05 [email protected] [fuchsia] Remove now unnecessary diagnostics directory (flutter/engine#51180) 2024-03-05 [email protected] [Impeller] Enable depth buffer clipping & Stencil-then-Cover path rendering. (flutter/engine#50856) 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] 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://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…dering. (flutter#50856) Turn the page, wash your hands. Addresses the following issues: * flutter/flutter#143077 * flutter/flutter#137714 * flutter/flutter#138460 * flutter/flutter#123671 * flutter/flutter#141961 * flutter/flutter#134432
…dering. (#51209) Turn the page, wash your hands. Addresses the following issues: * flutter/flutter#143077 * flutter/flutter#137714 * flutter/flutter#138460 * flutter/flutter#123671 * flutter/flutter#141961 * flutter/flutter#134432 Previous attempt: - #50856 - reverted with #51191 - fixed with #51198
… path rendering. (#51209)" (#51217) Reverts #51209 Initiated by: bdero Reason for reverting: Golden breakages on [engine roll](flutter/flutter#144647) https://flutter-gold.skia.org/search?issue=144647&crs=github&patchsets=5&corpus=flutter Original PR Author: bdero Reviewed By: {jonahwilliams, chinmaygarde} This change reverts the following previous change: Original Description: Turn the page, wash your hands. Addresses the following issues: * flutter/flutter#143077 * flutter/flutter#137714 * flutter/flutter#138460 * flutter/flutter#123671 * flutter/flutter#141961 * flutter/flutter#134432 Previous attempt: - #50856 - reverted with #51191 - fixed with #51198
…dering. (flutter#51209) Turn the page, wash your hands. Addresses the following issues: * flutter/flutter#143077 * flutter/flutter#137714 * flutter/flutter#138460 * flutter/flutter#123671 * flutter/flutter#141961 * flutter/flutter#134432 Previous attempts: 1. flutter#50856 - reverted with flutter#51191 - fixed with flutter#51198 2. flutter#51209 - reverted with flutter#51217 - fixed with flutter#51218
…dering. (#51219) Turn the page, wash your hands. Addresses the following issues: * flutter/flutter#143077 * flutter/flutter#137714 * flutter/flutter#138460 * flutter/flutter#123671 * flutter/flutter#141961 * flutter/flutter#134432 Previous attempts: 1. #50856 - reverted with #51191 - fixed with #51198 2. #51209 - reverted with #51217 - fixed with #51218
Turn the page, wash your hands.
Addresses the following issues: