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

Conversation

@bdero
Copy link
Member

@bdero bdero commented Apr 26, 2023

Reverts #40895.
Resolves flutter/flutter#120399 (again).

A bunch of frames get pumped on the main thread without a transaction just before unmerging occurs (I don't know why this happens), and so checking the current thread to determine whether we need to present with a transaction or not isn't sufficient. In the prior fix, after the unmerge, the raster thread would hang for one second while waiting for the next drawable to get freed up (happens on the second raster thread frame post-unmerge), and then subsequent presents would just do nothing for a while, but eventually recover.

presentsWithTransaction works whether the CATransaction stack is empty or not, and so the only difference here is that presentsWithTransaction is always turned on and presentDrawable is always avoided (otherwise it tries to present too early and nothing renders when platform views are present).

@bdero bdero requested a review from jonahwilliams April 26, 2023 02:59
@bdero bdero self-assigned this Apr 26, 2023
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@bdero
Copy link
Member Author

bdero commented Apr 26, 2023

FYI @chinmaygarde, this returned to the original plan of forcing one waitUntilScheduled on an empty command buffer prior to present.

@jonahwilliams
Copy link
Contributor

This PR results in the same issue I ran into when I just removed the waitUntilScheduled - the artifact discovery popup on wonderous doesn't show up.

@jonahwilliams
Copy link
Contributor

(From local testing)

@bdero bdero force-pushed the bdero/unmerge-fix branch 2 times, most recently from 00d978e to 58b59d3 Compare April 26, 2023 03:25
@bdero
Copy link
Member Author

bdero commented Apr 26, 2023

This PR results in the same issue I ran into when I just removed the waitUntilScheduled - the artifact discovery popup on wonderous doesn't show up.

Hmm, this behavior seems to be happening for me at HEAD, without these changes?

@jonahwilliams
Copy link
Contributor

Uh oh. I must be on an older commit in flutter/flutter, guess its time to bisect

@jonahwilliams
Copy link
Contributor

I looked in the range of commits from 6d79839 to 122c3b3 and the only thing that seemed relevant was the change to SetSupportsReadFromOnscreenTexture. I confirmed that setting that back to false fixes the artifact popup.

@bdero
Copy link
Member Author

bdero commented Apr 26, 2023

image

@bdero
Copy link
Member Author

bdero commented Apr 26, 2023

Fixed the artifact discovery problem here: #41509

@bdero bdero force-pushed the bdero/unmerge-fix branch from 58b59d3 to 1162035 Compare April 26, 2023 09:17
Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM

@bdero bdero merged commit 86118e5 into flutter:main Apr 26, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 26, 2023
jonahwilliams pushed a commit to flutter/flutter that referenced this pull request Apr 26, 2023
…125578)

flutter/engine@f2882af...cf97541

2023-04-26 [email protected] Migrate Windows AOT Engine to Engine
V2. (flutter/engine#41515)
2023-04-26 [email protected] [Impeller] Store the root stencil on iOS
(flutter/engine#41509)
2023-04-26 [email protected] [Impeller] iOS/macOS: Only wait for command
scheduling prior to present (redux) (flutter/engine#41501)
2023-04-26 [email protected] [Impeller]
removed collisions of dead command pools between tests.
(flutter/engine#41490)

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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

[Impeller] Investigate removal of waitUntilScheduled in Metal backend.

2 participants