Optimized the creation of CommandEncoders on WebGPU #7037
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The rendering on WebGPU used to create a new command encoder for each render pass, and also for other operations between the passes, like buffer upload / download, query resolves and similar.
Now this has been minimized to 2-3 a frame, depending on how the scheduling of dynamic buffer uploads needs to execute.
The hope is that this will minimize the gaps on the gpu between render passes, which this likely contributes to, at least on Apple HW. Follows this advice from Apple engineer:
This is the before capture, where the gaps can be observed. It seems the hea dof mini-browser is broken at the moment, and so I cannot capture after screenshot currently :(
Note especially the gaps between those tiny bloom blur passes, where the gaps are significantly larger than the passes themselves.