Fix switch index buffer from released customIA issue (#3107)

This commit is contained in:
pandamicro
2018-08-16 22:39:11 +08:00
committed by GitHub
parent 790020397f
commit ada1d1335c
+6 -1
View File
@@ -9642,7 +9642,12 @@ Device.prototype._restoreIndexBuffer = function _restoreIndexBuffer () {
var gl = this._gl;
var ib = this._current.indexBuffer;
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, ib ? ib._glID : null);
if (ib && ib._glID !== -1) {
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, ib._glID);
}
else {
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);
}
};
/**