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

[Impeller] Reland: add interface for submitting multiple command buffers at once. #50180

Merged
merged 24 commits into from
Jan 30, 2024

Conversation

jonahwilliams
Copy link
Member

Reland of: #50139

Metal does not seem to like it when we collect 50+ command buffers at once. Adjust the aiks context logic to regularly flush the cmd buffers.

std::shared_ptr<CommandBuffer> command_buffer) const {
pending_command_buffers_->command_buffers.push_back(
std::move(command_buffer));
// Metal systems seem to have a limit on the number of command buffers that
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 is the big change.

Copy link
Member

Choose a reason for hiding this comment

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

This still seems arbitrary. Can we flush pending command buffers when we can't create more or is there a delay between the flush and when we can acquire more buffers.

Copy link
Member

Choose a reason for hiding this comment

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

Or have the magic number of 10 as well as the flush and retry on allocation failure. Just having a backend specific magic number seems icky.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thinking about it more I should just make it immediately flush on metal, since we get no benefit from batching.

Copy link
Member Author

Choose a reason for hiding this comment

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

unfortunately there is no allocation failure, instead [queue commandBufferWithDescriptor:desc]; appears to hang.

Copy link
Member Author

Choose a reason for hiding this comment

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

removed the limit, now we Record -> Flush.

Copy link
Member

Choose a reason for hiding this comment

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

Oh well. Not having the arbitrary limit looks cleaner though.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah but it doesn't really matter for metal, I don't think we'll have a way to batch submit with that API ever.

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 30, 2024
@jonahwilliams jonahwilliams removed the autosubmit Merge PR when tree becomes green via auto submit App label Jan 30, 2024
@chinmaygarde
Copy link
Member

Did you mean to remove the autosub label?

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 30, 2024
@auto-submit auto-submit bot merged commit 5b37aef into flutter:main Jan 30, 2024
31 checks passed
@jonahwilliams jonahwilliams deleted the queue_based_submitter branch January 30, 2024 21:22
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 30, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Jan 31, 2024
…142564)

flutter/engine@d20ed24...e6e1d6b

2024-01-30 skia-flutter-autoroll@skia.org Roll Dart SDK from 734aae9604e8 to 488e33cd39de (1 revision) (flutter/engine#50185)
2024-01-30 jonahwilliams@google.com [Impeller]  Reland: add interface for submitting multiple command buffers at once. (flutter/engine#50180)
2024-01-30 iinozemtsev@google.com Support running sound null safe kernels from flutter_jit_runner (flutter/engine#50002)

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 matanl@google.com,rmistry@google.com,zra@google.com 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
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-android
Projects
No open projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants