Skip to content
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

[egui-wgpu] Do vertex & index buffer in a single copy each #2820

Merged
merged 3 commits into from
Mar 29, 2023

Conversation

Wumpf
Copy link
Collaborator

@Wumpf Wumpf commented Mar 17, 2023

Also, copy uniform buffer only if necessary.
Previously, we did hundreds of small copies via queue.write_buffer which would create a new buffer for each of these copies. Now, there are only two gpu sided copy operations and the memory goes directly to the staging buffer. In a quick debug test on Rerun this decreased time for the update_buffer method from about 0.87ms to 0.37ms!

(This was an attempt to fix rerun-io/rerun#909 but it does not do so)

Also, copy uniform buffer only if necessary.
Previously, we did hundreds of small copies via queue.write_buffer which would create a new buffer for each of these copies. Now, there are only two gpu sided copy operations and the memory goes directly to the staging buffer.
In a quick debug test on Rerun this decreased time for the `update_buffer` method from about 0.87ms to 0.37ms!
@Wumpf Wumpf force-pushed the egui-wgpu-buffer-copy-optimization branch from ab23330 to 4a0d587 Compare March 17, 2023 10:03
crates/egui-wgpu/src/renderer.rs Outdated Show resolved Hide resolved
@Wumpf Wumpf merged commit b1f837c into master Mar 29, 2023
@Wumpf Wumpf deleted the egui-wgpu-buffer-copy-optimization branch March 29, 2023 17:30
@emilk emilk added performance Lower CPU/GPU usage (optimize) egui-wgpu labels Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
egui-wgpu performance Lower CPU/GPU usage (optimize)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

web: memory constantly grows then shrinks for seemingly no reason
2 participants