diff --git a/wgpu/src/triangle.rs b/wgpu/src/triangle.rs index 0a118bd2..85ed4bd5 100644 --- a/wgpu/src/triangle.rs +++ b/wgpu/src/triangle.rs @@ -330,12 +330,17 @@ impl Pipeline { &[(std::mem::size_of::() * i) as u64], ); - render_pass - .set_index_buffer(&self.index_buffer.raw, index_offset); + render_pass.set_index_buffer( + &self.index_buffer.raw, + index_offset * std::mem::size_of::() as u64, + ); render_pass.set_vertex_buffers( 0, - &[(&self.vertex_buffer.raw, vertex_offset)], + &[( + &self.vertex_buffer.raw, + vertex_offset * std::mem::size_of::() as u64, + )], ); render_pass.draw_indexed(0..indices as u32, 0, 0..1);