Set offsets in buffer slices in `iced_wgpu`
This commit is contained in:
parent
8d605be4e3
commit
7559e4fb30
|
@ -379,17 +379,20 @@ impl Pipeline {
|
|||
&[(std::mem::size_of::<Uniforms>() * i) as u32],
|
||||
);
|
||||
|
||||
render_pass.set_index_buffer(self.index_buffer.raw.slice(..));
|
||||
|
||||
render_pass
|
||||
.set_vertex_buffer(0, self.vertex_buffer.raw.slice(..));
|
||||
|
||||
render_pass.draw_indexed(
|
||||
index_offset as u32
|
||||
..(index_offset as usize + indices) as u32,
|
||||
vertex_offset as i32,
|
||||
0..1,
|
||||
render_pass.set_index_buffer(
|
||||
self.index_buffer
|
||||
.raw
|
||||
.slice(index_offset * mem::size_of::<u32>() as u64..),
|
||||
);
|
||||
|
||||
render_pass.set_vertex_buffer(
|
||||
0,
|
||||
self.vertex_buffer.raw.slice(
|
||||
vertex_offset * mem::size_of::<Vertex2D>() as u64..,
|
||||
),
|
||||
);
|
||||
|
||||
render_pass.draw_indexed(0..indices as u32, 0, 0..1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue