fix: formatting code for draw model

pull/432/head
erwanvivien 1 year ago committed by GitHub
parent 8c4d2b5871
commit f042b8d88c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -389,12 +389,9 @@ Before we can draw the model, we need to be able to draw an individual mesh. Let
// model.rs
pub trait DrawModel<'a> {
fn draw_mesh(&mut self, mesh: &'a Mesh);
fn draw_mesh_instanced(
&mut self,
mesh: &'a Mesh,
instances: Range<u32>,
);
fn draw_mesh_instanced(&mut self, mesh: &'a Mesh, instances: Range<u32>);
}
impl<'a, 'b> DrawModel<'b> for wgpu::RenderPass<'a>
where
'b: 'a,
@ -403,11 +400,7 @@ where
self.draw_mesh_instanced(mesh, 0..1);
}
fn draw_mesh_instanced(
&mut self,
mesh: &'b Mesh,
instances: Range<u32>,
){
fn draw_mesh_instanced(&mut self, mesh: &'b Mesh, instances: Range<u32>) {
self.set_vertex_buffer(0, mesh.vertex_buffer.slice(..));
self.set_index_buffer(mesh.index_buffer.slice(..), wgpu::IndexFormat::Uint32);
self.draw_indexed(0..mesh.num_elements, 0, instances);

Loading…
Cancel
Save