Closed Fuzzyzilla closed 9 months ago
Always unsure on whether I should bundle the changes into one PR since they're a bit disjoint -- please advise!
The smaller the PR the easier it is to review and less chance for mistakes. So Separate PRs 👍
This one is also appreciated! Don't see anything blocking the merge other than lints & merge conflicts
Alright, merged and fixed up! Did a few reads over and I'm happy enough with it to open this up. I hope I did alright with the merge, still learning git.
Doubles the framerate over master when compared using a modified
demo_app.rs
withPresentMode::Mailbox
and a few spare swapchain images,
I should not be allowed to benchmark/write PR messages at 2am. The improvements are much more modest at ~25% improvement in frametimes. The other improvements are still true - I just have no idea how i got that number lol.
Replaces the allocate-as-needed logic with bulk linear allocations for both image create, image update, and mesh upload.
Doubles the framerate over masterwhen compared using a modifieddemo_app.rs
withPresentMode::Mailbox
and a few spare swapchain images, even using 1% less of my CPU while doing so. It also starts up a sixteenth of a second faster, clearly the largest benefit here :PImage uploads are now batched per-frame and only synchronize once. Should help with stutter on UIs that load/modify fonts or images frequently (Scrubbing the font size slider on the
demo_app
's FontBook is a good example).Mesh uploads now only memmap the buffers twice-per-frame instead of twice-per-mesh.
bytemuck
this could be further reduced to a single memmap per frame, but it would require a private dependency addition and a public egui feature flag change for a somewhat trivial perf boost, and I'm not sure the policy on that (could also be achieved with some fairly trivialunsafe
ops).It should use substantially less memory during these operations, but I do not have a convenient way to measure. On current master, image creation/deltas involve 4 in-memory copies, reduced here to 2.
I have further optimizations in mind, namely deduplicating command buffer commands, as there are currently ~250 commands for 20 meshes which could be greatly reduced. Always unsure on whether I should bundle the changes into one PR since they're a bit disjoint -- please advise!