Open Firestar99 opened 1 month ago
I'm seeing some weird performance behavior in bistro I would like to investigate first before officially submitting this Resolved: attached RenderDoc hates super large cmd buffers of 3000+ draws.
I'm uncertain how secondary cmd buffers are handled. I could imagine a usecase, when they contain many draws with always changing pipelines (which is generally frowned upon anyways) and with very few buffers used, that could maybe be slower with this PR. But I dunno, that may need some testing.
Result: secondary cmd buffers have also improved significantly, 40fps to 120fps (meshlet on sponza), but it still is significantly better to just record everything into the primary cmd buffer, where I could reach 550fps.
[x] Update documentation to reflect any user-facing changes - in this repository.
[ ] Make sure that the changes are covered by unit-tests.
[x] Run
cargo clippy
on the changes.[x] Run
cargo +nightly fmt
on the changes.[x] Please put changelog entries in the description of this Pull Request if knowledge of this change could be valuable to users. No need to put the entries to the changelog directly, they will be transferred to the changelog file by maintainers right after the Pull Request merge.
Please remove any items from the template below that are not applicable.
[x] Describe in common words what is the purpose of this change, related Github Issues, and highlight important implementation aspects.
Profiling based on my meshlet demo on sponza. Before at ~40fps and fully CPU limited:![image](https://github.com/vulkano-rs/vulkano/assets/31222740/b1f0a81d-9d8c-41b1-83f2-06abea7ac062)
With this PR I get ~550fps and am most likely CPU GPU sync limited, due not having a working frame in flight system.![image](https://github.com/vulkano-rs/vulkano/assets/31222740/248887db-06a4-4cc7-b443-70928b66d773)
And the best part is: It's absolutely free and still safe! (if I didn't mess up)
Current master evaluates all accessed resources (buffers, images) if you call any draw or dispatch immediately. My change defers the evaluation specifically of descriptor sets for their resources to the end of the cmd buffer recording. This allows me to deduplicate draws and dispatches using the same pipeline, merging their resources and descriptor sets together, and then deduplicate the descriptor sets again before evaluating each unique one for their actual resources. You may even be able to merge more than that, but I'd rather be on the conservative side with different pipelines.
Changelog: