diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index 072278a..bcd73d0 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -129,6 +129,7 @@ if (!webGL) { webGL = graphics._webGL[gl.id] = {lastIndex:0, data:[], gl:gl}; + } @@ -208,26 +209,13 @@ { var webGLData; - if (!webGL.data.length) + if (!webGL.data.length || webGLData.points.length > 320000) { webGLData = this.graphicsDataPool.pop() || new WebGLGraphicsData(webGL.gl, this.primitiveShader); webGLData.reset(type); webGL.data.push(webGLData); } - else - { - webGLData = webGL.data[webGL.data.length-1]; - - if (webGLData.points.length > 320000) - { - webGLData = this.graphicsDataPool.pop() || new WebGLGraphicsData(webGL.gl, this.primitiveShader); - webGLData.reset(type); - webGL.data.push(webGLData); - } - } webGLData.dirty = true; - - return webGLData; };