Open DGriffin91 opened 6 months ago
You might be able to improve the performance by using a bindless approach where you record one subpass and use push constants or gl_InstanceIndex
to change what index the next draw references out of that bindless array. Example.
If you are changing other bindings or pipelines this won't help because the code at graph/resolver.rs:1108
ultimately creates one subpass for each "exec" (each call to record_subpass
).
This could be done in a smarter way to avoid creating new subpasses when the rules allow. There is also some performance left on the table because fresh descriptor sets are written and bound for each subpass. I can't say how soon I can fix these items they should not change any public API.
... it's very slow ...
There is a performance tax of the runtime approach compared to pre-baked command buffers and descriptor sets. I do think there should be a compatible solution for times when a section of the render graph is known to stay the same or just need descriptor writes. Right now it's possible to use record_cmd_buf
and do raw Vulkan inside of a larger graph but I would like to provide a better solution.
Aside from finding solutions that might work for you in the meantime, I see three issues to correct here:
Thanks for your reply. And thanks for your work on this project, it's really awesome!
I am planning on using bindless where possible. But there's some cases where rebinding within a pass is somewhat inevitable.
It would be great to be able to cache/record pipelines, descriptor sets, etc... In my case, the majority of these don't change from frame to frame.
I'm trying to figure out the best way to bind a different uniform buffer for each draw where each uniform has the same layout, and the rest of the pass/pipeline remains consistent.
Another example would be changing texture bindings for each draw within the same pass.
This is what I've tried, but it's very slow as it results in a new subpass for every draw. It's my understanding that in vulkan, pipelines and bindings can change within a subpass (but not attachments).