-
Notifications
You must be signed in to change notification settings - Fork 844
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
Why webgpu produces that many command buffers in metal? #5721
Comments
a lot of it happens because of the way wgpu has to stitch command buffers together for barriers. But I believe some if it also wgpu-hal too eagerly creating new command buffers of certain type and then needing to close it again because a different type is needed. Meaning, I would expect that we could do a lot better here - in particular the debug group only command buffers seem a bit odd, but likely are the sideeffect of something higher up in wgpu-core. @cwfitzgerald might have more details on it |
Reported more accurate question in #5738 |
I also added more detailed card #5738 that contains more investigation |
Thank you for digging deeper and putting up the more accurate problem description & actionable performance issue! I think with that you answered the original question yourself much better than I tried earlier here. Closing in favor of #5738 |
Is there a reason why webgpu produces that many command buffers in metal? It appears that each pass not only produces separate command buffer, but also another empty one for pass creation.
Personally, I do not know full overhead of command buffer, but at least apple recommends keeping them to minimum. For single threaded app usually one command buffer per full frame.
Here is example code of outline rendering that is composed out of three passes.
In xcode capture it shows that each pass end up being added into different command buffer and additional empty one. It seems even push/pop debug commands end up being in separate command buffer.
The text was updated successfully, but these errors were encountered: