Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] Ensure FlutterMetalLayer has correct backpressure. #50486

Merged
merged 8 commits into from
Feb 15, 2024

Conversation

jonahwilliams
Copy link
Member

@jonahwilliams jonahwilliams commented Feb 9, 2024

See also flutter/flutter#140901 . We were not accounting for GPU backpressure in the FML, this applies the patch from @knopp to track this.

@@ -236,4 +236,42 @@ - (void)testLayerLimitsDrawableCount {
[self removeMetalLayer:layer];
}

- (void)testTimeout {
Copy link
Member Author

Choose a reason for hiding this comment

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

This needs more thought, I haven't actually looked at how to grab the usage flag in the test yet

Copy link
Member

@knopp knopp Feb 13, 2024

Choose a reason for hiding this comment

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

The test fails because isInUse=true doesn't prevent layer from returning the surface.

isInUse=false: Compositor is definitely not using the surface. This is useful to reuse surface immediately after a dropped frame.
isInUse=true: Compositor may be using the surface. if there is no surface with isInUse=false, return one with isUnUse=true that was presented longest time ago.

The blocking in this PR is performed when front surface command buffer has not been completed. This is different from compositor using the surface. The test will likely need to call flutterPrepareForPresent: with command buffer and then test if nextSurface blocks while the command buffer waits for completion.

@knopp
Copy link
Member

knopp commented Feb 14, 2024

@jonahwilliams, I added PR for the test in jonahwilliams#1

@jonahwilliams
Copy link
Member Author

Thank you!

@jonahwilliams jonahwilliams changed the title Fix flutter metal layer bp [iOS] Ensure FlutterMetalLayer has correct backpressure. Feb 14, 2024
@jonahwilliams jonahwilliams marked this pull request as ready for review February 14, 2024 18:13
Copy link
Member

@knopp knopp left a comment

Choose a reason for hiding this comment

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

Tested this. LGTM!

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 15, 2024
@auto-submit auto-submit bot merged commit 5548b4b into flutter:main Feb 15, 2024
29 checks passed
sealesj pushed a commit to sealesj/engine that referenced this pull request Feb 15, 2024
See also flutter/flutter#140901 . We were not accounting for GPU backpressure in the FML, this applies the patch from @knopp to track this.
jason-simmons added a commit to jason-simmons/flutter that referenced this pull request Feb 16, 2024
2024-02-15 30870216+gaaclarke@users.noreply.github.com Added tool to easily check golden diffs locally. (flutter/engine#50654)
2024-02-15 skia-flutter-autoroll@skia.org Roll Skia from 4bbf2060b008 to 12d0b7fac4c3 (2 revisions) (flutter/engine#50689)
2024-02-15 johnoneil@users.noreply.github.com Provide a matrix inverse shim for GLES 2.0. (flutter/engine#50545)
2024-02-15 jonahwilliams@google.com [iOS] Ensure FlutterMetalLayer has correct backpressure. (flutter/engine#50486)
2024-02-15 skia-flutter-autoroll@skia.org Roll Skia from 682f0e1e7e77 to 4bbf2060b008 (3 revisions) (flutter/engine#50686)
2024-02-15 103135467+sealesj@users.noreply.github.com Pin OSV-Scanner reusable workflow (flutter/engine#50649)
2024-02-15 whesse@google.com Add support for dart_src GN variable to flutter_frontend_server build (flutter/engine#50685)
2024-02-15 6718144+renancaraujo@users.noreply.github.com fix: consider array size on canvaskit shader data (flutter/engine#49754)
2024-02-15 skia-flutter-autoroll@skia.org Roll Skia from 1277910beec9 to 682f0e1e7e77 (1 revision) (flutter/engine#50683)
2024-02-15 skia-flutter-autoroll@skia.org Roll Skia from 85ab600a9519 to 1277910beec9 (2 revisions) (flutter/engine#50682)
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Feb 16, 2024
2024-02-15 30870216+gaaclarke@users.noreply.github.com Added tool to easily check golden diffs locally. (flutter/engine#50654)
2024-02-15 skia-flutter-autoroll@skia.org Roll Skia from 4bbf2060b008 to 12d0b7fac4c3 (2 revisions) (flutter/engine#50689)
2024-02-15 johnoneil@users.noreply.github.com Provide a matrix inverse shim for GLES 2.0. (flutter/engine#50545)
2024-02-15 jonahwilliams@google.com [iOS] Ensure FlutterMetalLayer has correct backpressure. (flutter/engine#50486)
2024-02-15 skia-flutter-autoroll@skia.org Roll Skia from 682f0e1e7e77 to 4bbf2060b008 (3 revisions) (flutter/engine#50686)
2024-02-15 103135467+sealesj@users.noreply.github.com Pin OSV-Scanner reusable workflow (flutter/engine#50649)
2024-02-15 whesse@google.com Add support for dart_src GN variable to flutter_frontend_server build (flutter/engine#50685)
2024-02-15 6718144+renancaraujo@users.noreply.github.com fix: consider array size on canvaskit shader data (flutter/engine#49754)
2024-02-15 skia-flutter-autoroll@skia.org Roll Skia from 1277910beec9 to 682f0e1e7e77 (1 revision) (flutter/engine#50683)
2024-02-15 skia-flutter-autoroll@skia.org Roll Skia from 85ab600a9519 to 1277910beec9 (2 revisions) (flutter/engine#50682)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App e: impeller platform-ios
Projects
None yet
2 participants