-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
WebGPU: BindGroups aren't being reused #6315
Comments
BindGroup is actually re-used as much as possible. Only when it's content changes a new one is created. The reason a bind group is re-created:
Plan to improve this:
I wish I had better options at the moment, but as they say here gpuweb/gpuweb#915, Thanks for the issue. I'll close it for now, as I do not see a way to improve this, but will always keen an eye on it. |
Actually, let me re-open this. I see a solution, I'll try it soon:
|
So it seems the solution works. Slightly more complicated due to bind group keeping the size of the UB, but that's still pretty good. Initial implementation is here, applied to the clear-renderer only: #6341, but next I'll work on applying this to the mesh bind groups, which is bit more involved. |
When using https://github.com/brendan-duncan/webgpu_inspector to look at what is happening, it's very obvious that BindGroups are constantly being created, up to a 20000 sometimes, and then being garbage collected. This then causes a lag spike.
It would be more optimal to reuse BindGroups.
The text was updated successfully, but these errors were encountered: