-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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] Investigate removal of waitUntilScheduled
in Metal backend.
#120399
Comments
waitUntilScheduled
in Metal backend.
In the wonderous app, removing |
Did you attach the wrong screenshot? That is showing the wait for the next drawable. That is the backpressure mechanism (the GPU telling us we are running ahead of its ability to render the stuff we are telling it to) and this issue isn't describing getting rid of it. I got rid of the need for this wait as I am wiring up the Vulkan backend and have some notes on how we can do the same for Metal. We can discuss it in the weekly or an OOB sync perhaps? |
No, take a look at the command buffer upload part. It's all waitUntilScheduled |
Weekly sounds fine fyi, just doing some investigating |
This is what I added for tracing, I believe it should be accurate. @@ -164,6 +168,7 @@ bool CommandBufferMTL::OnSubmitCommands(CompletionCallback callback) {
}
[buffer_ commit];
+ TRACE_EVENT0("impeller", "CommandBufferMTL::waitUntilScheduled");
[buffer_ waitUntilScheduled];
buffer_ = nil;
return true; |
Note for myself to try to assimilate the ordering guarantees in Metal. |
Fixed by @bdero in flutter/engine#40781. We were on the wrong lines of investigation w.r.t hazard tracking. |
The fix was reverted in flutter/engine#40895. |
…nt (redux) (#41501) 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).
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
This is necessary today because Impeller doesn't do resource hazard tracking across render passes. This introduces bubbles in execution on the GPU which wastes available concurrency.
The text was updated successfully, but these errors were encountered: