Skip to content

webgl unbound buffer warning for empty non-directDraw StageGL #978

@adabru

Description

@adabru

Using master branch (commit c7b6035) the following lines:

var stage = new createjs.StageGL("testcanvas", {directDraw:false})
stage.update()

create this webgl warning (Ubuntu 16.04, Chrome 69.0.3497.42 beta 64-bit):

WebGL: INVALID_OPERATION: drawArrays: no buffer is bound to enabled attribute
    p._renderCover @ easeljs-NEXT.js:11763
    p._drawCover @ easeljs-NEXT.js:11389
    p.draw @ easeljs-NEXT.js:10251
    p.update @ easeljs-NEXT.js:10182

If I add something renderable to the scene, the warning doesn't appear:

var shape = new createjs.Shape()
shape.cache(0,0,50,50)
stage.addChild(shape)
// this update call won't cause a webgl warning anymore
stage.update()

https://codepen.io/adabru/pen/OoPaLN/?editors=1000

The affected code is in the functions StageGL@_renderCover and StageGL@_renderBatch I guess. In these functions some gl.bindBuffer, gl.vertexAttribPointer and gl.bufferSubData are called. If I add the gl functions from _renderBatch inside of _renderCover, the warning also disappears. I guess that is the reason why the warning doesn't appear when the stage has some children.

As workaround I add an empty, useless shape to the scene.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions