Struggling with render pass lifetime #3832
-
Hello, I'm trying to do a simple framework for experiments in webgpu, nothing super fancy but I'm struggling with render pass lifetime and the best way to architecture. I'm taking the
where state is a struct containing the adapter, device, queue etc... and inside the render function:
but I get an error:
The main reason for that would be to have the default render pass created as well dear imgui, so I wound't have to do this for every example. I've been trying a couple of different things now and most of the time I run into some similar issue and TBH is very frustrating :/
anyway, any help is appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Your signature should look like this: fn render<'rpass>(&'rpass self, state: &State, rpass: &mut RenderPass<'rpass>) This tells rust that data from within self can flow into the renderpass. |
Beta Was this translation helpful? Give feedback.
You put the lifetime in the wrong place