Skip to content

Commit

Permalink
don't try to draw empty meshes
Browse files Browse the repository at this point in the history
  • Loading branch information
edwloef committed Feb 3, 2025
1 parent 0c0651d commit 61750c2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions wgpu/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,10 @@ impl core::svg::Renderer for Renderer {

impl graphics::mesh::Renderer for Renderer {
fn draw_mesh(&mut self, mesh: graphics::Mesh) {
let (layer, transformation) = self.layers.current_mut();
layer.draw_mesh(mesh, transformation);
if !mesh.indices().is_empty() {
let (layer, transformation) = self.layers.current_mut();
layer.draw_mesh(mesh, transformation);
}
}
}

Expand Down

0 comments on commit 61750c2

Please sign in to comment.