From 1af8e63641b3fa4741e33ad3f040fe367497e3e0 Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Wed, 15 Jun 2022 21:48:30 +0200 Subject: [PATCH] Stabilize mesh renderer --- src/render/mesh.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/render/mesh.rs b/src/render/mesh.rs index ed1f626..93b3b47 100644 --- a/src/render/mesh.rs +++ b/src/render/mesh.rs @@ -56,10 +56,10 @@ impl Renderable for Mesh { fn render<'a>(&'a self, render_pass: &mut wgpu::RenderPass<'a>) { render_pass.set_bind_group(0, &self.texture_bind_group.as_ref().unwrap(), &[]); - render_pass.set_vertex_buffer(0, self.vertex_buffer.as_ref().unwrap().slice(..).clone()); + render_pass.set_vertex_buffer(0, self.vertex_buffer.as_ref().unwrap().slice(..)); render_pass.set_vertex_buffer(1, self.instance_buffer.as_ref().unwrap().slice(..)); render_pass.set_index_buffer(self.index_buffer.as_ref().unwrap().slice(..), wgpu::IndexFormat::Uint16); - render_pass.draw_indexed(0..self.index_array.len() as _, 0, 0..self.num_indices); + render_pass.draw_indexed(0..self.num_indices as _, 0, 0..self.instance_array.len() as _); } } \ No newline at end of file