Issue draw calls only when necessary
This commit is contained in:
parent
2b23e0986c
commit
23ebfb707a
1 changed files with 21 additions and 17 deletions
|
|
@ -294,25 +294,29 @@ impl Renderer {
|
||||||
let translated = transformation
|
let translated = transformation
|
||||||
* Transformation::translate(0.0, -(layer.y_offset as f32));
|
* Transformation::translate(0.0, -(layer.y_offset as f32));
|
||||||
|
|
||||||
self.quad_pipeline.draw(
|
if layer.quads.len() > 0 {
|
||||||
&mut self.device,
|
self.quad_pipeline.draw(
|
||||||
encoder,
|
&mut self.device,
|
||||||
&layer.quads,
|
encoder,
|
||||||
transformation,
|
&layer.quads,
|
||||||
layer.bounds,
|
transformation,
|
||||||
target,
|
layer.bounds,
|
||||||
);
|
target,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
self.image_pipeline.draw(
|
if layer.images.len() > 0 {
|
||||||
&mut self.device,
|
self.image_pipeline.draw(
|
||||||
encoder,
|
&mut self.device,
|
||||||
&layer.images,
|
encoder,
|
||||||
translated,
|
&layer.images,
|
||||||
layer.bounds,
|
translated,
|
||||||
target,
|
layer.bounds,
|
||||||
);
|
target,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
{
|
if layer.text.len() > 0 {
|
||||||
let mut glyph_brush = self.glyph_brush.borrow_mut();
|
let mut glyph_brush = self.glyph_brush.borrow_mut();
|
||||||
|
|
||||||
for text in layer.text.iter() {
|
for text in layer.text.iter() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue