render rectangles correctly
prevent draw call if batch is empty
@@ -244,6 +244,7 @@ impl Renderer2d {
quad.set_buffer_data(state, 1, &self.instance_data_set);
+ if !self.instance_data_set.is_empty() {
let shader = &self.sprite_shader;
stats += frame_buffer.draw_instances(
self.instance_data_set.len(),
@@ -276,6 +277,7 @@ impl Renderer2d {
},
);
}
+ }
Ok(stats)
}
