Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[Impeller] use final cmd buffer to present drawable.
  • Loading branch information
jonahwilliams committed Sep 19, 2023
commit c4b319703c28b60f72f27ad468e1b82ac0661ea0
12 changes: 8 additions & 4 deletions impeller/renderer/backend/metal/surface_mtl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -248,13 +248,17 @@
}

if (drawable_) {
TRACE_EVENT0("flutter", "waitUntilScheduled");
Copy link
Member

Choose a reason for hiding this comment

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

Should we keep this trace, but move it into waitUntilScheduled's new scope?

id<MTLCommandBuffer> command_buffer =
ContextMTL::Cast(context.get())
->CreateMTLCommandBuffer("Present Waiter Command Buffer");
[command_buffer commit];
[command_buffer waitUntilScheduled];
[drawable_ present];
if ([[NSThread currentThread] isMainThread]) {
[command_buffer commit];
[command_buffer waitUntilScheduled];
[drawable_ present];
} else {
[command_buffer presentDrawable:drawable_];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh wait, I need to double check if this messes up frame capture. If so we need to check if we're capturing a frame and block.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

[command_buffer commit];
}
}

return true;
Expand Down