Lifetimes on RenderPass
make it difficult to use. #1453
Closed
Description
Related PRs:
gfx-rs/wgpu-rs#155
gfx-rs/wgpu-rs#168
For context, I was looking at updating imgui-wgpu to work with the current master.
Now that set_index_buffer
(and similar methods) take the a &'a Buffer
instead of &Buffer
, it has a ripple effect of "infecting" the surrounding scope with this lifetime.
While attempting to iterate and add draw calls, you end up with either "multiple mutable borrow" errors on wherever you're storing the Buffer
or similar lifetime errors like "data from self
flows into rpass
here"
I would think that by calling set_index_buffer
(and similar methods) that it would increment the ref-count on the buffer so that this lifetime restriction isn't needed.