Skip to content

Commit 49bcb58

Browse files
committed
Added mesh rendering detection
1 parent 399e12b commit 49bcb58

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

v3/src/renderer/webgl/renderers/spritebatch/SpriteBatch.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ var SpriteBatch = function (game, gl, manager)
4646
this.dirty = false;
4747
this.drawIndexed = true;
4848
this.lastDrawIndexed = true;
49+
this.lastDrawingMesh = false;
4950
this.drawingMesh = false;
5051
this.vertexCount = 0;
5152

@@ -100,9 +101,10 @@ SpriteBatch.prototype = {
100101

101102
shouldFlush: function ()
102103
{
103-
if (this.drawIndexed != this.lastDrawIndexed)
104+
if (this.drawIndexed != this.lastDrawIndexed || this.lastDrawingMesh !== this.drawingMesh)
104105
{
105106
this.lastDrawIndexed = this.drawIndexed;
107+
this.lastDrawingMesh = this.drawingMesh;
106108
return true;
107109
}
108110
return false;

0 commit comments

Comments
 (0)