Skip to content

Lifetimes on RenderPass make it difficult to use.  #1453

Closed
@aloucks

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.

Metadata

Assignees

No one assigned

    Labels

    area: apiIssues related to API surfacearea: ecosystemHelp the connected projects grow and prospertype: enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions