diff --git a/gui/src/rust/ensogl/src/display/symbol/gpu.rs b/gui/src/rust/ensogl/src/display/symbol/gpu.rs index cde44f4a0c..3074280632 100644 --- a/gui/src/rust/ensogl/src/display/symbol/gpu.rs +++ b/gui/src/rust/ensogl/src/display/symbol/gpu.rs @@ -270,12 +270,14 @@ impl { let first = 0; let count = self.surface.point_scope().size() as i32; let instance_count = self.surface.instance_scope().size() as i32; - let instance_count = std::cmp::max(instance_count,1); self.stats.inc_draw_call_count(); - self.context.draw_arrays_instanced(mode,first,count,instance_count); + if instance_count > 0 { + self.context.draw_arrays_instanced(mode,first,count,instance_count); + } else { + self.context.draw_arrays(mode,first,count); + } }); - }) } }} diff --git a/gui/src/rust/ensogl/src/system/gpu/data/buffer.rs b/gui/src/rust/ensogl/src/system/gpu/data/buffer.rs index 437a7a8d7f..a0425ae922 100644 --- a/gui/src/rust/ensogl/src/system/gpu/data/buffer.rs +++ b/gui/src/rust/ensogl/src/system/gpu/data/buffer.rs @@ -90,6 +90,7 @@ impl { stats.inc_buffer_count(); let mut_dirty = MutDirty::new(logger.sub("mut_dirty"),Callback(on_mut)); let resize_dirty = ResizeDirty::new(logger.sub("resize_dirty"),Callback(on_resize)); + resize_dirty.set(); let on_resize_fn = on_resize_fn(resize_dirty.clone_ref()); let on_mut_fn = on_mut_fn(mut_dirty.clone_ref()); let buffer = ObservableVec::new(on_mut_fn,on_resize_fn);