-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Significant performance difference between CommandEncoder::copy_buffer_to_buffer and Queue::write_buffer #1994
Comments
What backend is this?
We can keep this issue to track the optimization status. |
This is the vulkan backend (linux + nvidia gtx 1070 + proprietary drivers). I also forgot to mention that this is still wgpu 0.9 (we aren't upgrading bevy to the new wgpu until rust 2021 drops and the new feature resolver becomes the default). If the write_buffer implementation has changed significantly since the move to wgpu-hal, I'm happy to table this conversation until we upgrade. |
For Vulkan, I think the logic is generally the same. Other backends behave differently now. |
I have a few more things to sort out on our end before I can commit time to this, but I can definitely do that soon-ish :) |
Just created a Bevy branch that uses the latest wgpu master. I'm happy to report that while there is still a performance difference, it is much smaller now. After running the benchmark mentioned above with/without the Queue changes, using Queue seems to cost us an additional ~0.3 milliseconds. |
This is great news! We can bring this to 0, it's an internal optimization thing. Don't consider the difference to be permanent ;) |
Any updates on this? |
In the new bevy renderer we just ported our "sprite vertex attribute buffer copy" from staging-buffers to Queue::write_buffer.
pipelined-rendering with staging buffers: bevyengine/bevy@fb33d59
pipelined-rendering with queue::write_buffer: bevyengine/bevy#2847
On our
bevymark
example with 60,000 sprites, we're seeing a 2.683 millisecond regression (~5 fps) after the move to Queue::write_buffer. This seems odd given that (to my understanding) they're doing basically the same thing (Queue has an internal staging buffer that gets written to the actual buffer at the start of the next submit).The text was updated successfully, but these errors were encountered: