Fix bug in egui-wgpu (#1716)

This commit is contained in:
Zicklag 2022-06-09 08:59:43 -05:00 committed by GitHub
parent 8446665b02
commit 62a00c4597
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -370,6 +370,11 @@ impl RenderPass {
// Skip rendering with zero-sized clip areas.
if width == 0 || height == 0 {
// If this is a mesh, we need to advance the index and vertex buffer iterators
if let Primitive::Mesh(_) = primitive {
index_buffers.next().unwrap();
vertex_buffers.next().unwrap();
}
continue;
}
@ -377,10 +382,10 @@ impl RenderPass {
match primitive {
Primitive::Mesh(mesh) => {
if let Some((_texture, bind_group)) = self.textures.get(&mesh.texture_id) {
let index_buffer = index_buffers.next().unwrap();
let vertex_buffer = vertex_buffers.next().unwrap();
let index_buffer = index_buffers.next().unwrap();
let vertex_buffer = vertex_buffers.next().unwrap();
if let Some((_texture, bind_group)) = self.textures.get(&mesh.texture_id) {
rpass.set_bind_group(1, bind_group, &[]);
rpass.set_index_buffer(
index_buffer.buffer.slice(..),