I am trying to render something with wgpu with this simplefied methods:
fn render<'a>(&'a self, engine: &'a GameEngine, render_pass: &mut RenderPass<'a>, device: &Device, queue: &Queue) {
let w = self.world.read().unwrap();
w.render(engine,render_pass,device,queue);
}
The world render method is baseclly the same:
pub fn render<'a>(&'a self, engine: &'a GameEngine, render_pass: &mut RenderPass<'a>, device: &Device, queue: &Queue) {
}
But it doesn't work because of lifetime errors:
w.render(engine,render_pass,device,queue);
| ^--------------------------------------------------------------------------------------
| |
| borrowed value does not live long enough
| argument requires that `w` is borrowed for `'a`
It seems like that the RwLock read() has a wrong lifetime or something I don't really now. I hope you can help me.