[threejs] Don't mark buffer objects for an update if they are zero length. Fixes #1345.

This commit is contained in:
badlogic 2019-05-15 17:15:36 +02:00
parent 23982e8206
commit 2dc619a76c
5 changed files with 8 additions and 8 deletions

View File

@ -9865,11 +9865,11 @@ var spine;
this.indicesLength += indicesLength;
};
MeshBatcher.prototype.end = function () {
this.vertexBuffer.needsUpdate = true;
this.vertexBuffer.needsUpdate = this.verticesLength > 0;
this.vertexBuffer.updateRange.offset = 0;
this.vertexBuffer.updateRange.count = this.verticesLength;
var geo = this.geometry;
geo.getIndex().needsUpdate = true;
geo.getIndex().needsUpdate = this.indicesLength > 0;
geo.getIndex().updateRange.offset = 0;
geo.getIndex().updateRange.count = this.indicesLength;
geo.drawRange.start = 0;

File diff suppressed because one or more lines are too long

View File

@ -6995,11 +6995,11 @@ var spine;
this.indicesLength += indicesLength;
};
MeshBatcher.prototype.end = function () {
this.vertexBuffer.needsUpdate = true;
this.vertexBuffer.needsUpdate = this.verticesLength > 0;
this.vertexBuffer.updateRange.offset = 0;
this.vertexBuffer.updateRange.count = this.verticesLength;
var geo = this.geometry;
geo.getIndex().needsUpdate = true;
geo.getIndex().needsUpdate = this.indicesLength > 0;
geo.getIndex().updateRange.offset = 0;
geo.getIndex().updateRange.count = this.indicesLength;
geo.drawRange.start = 0;

File diff suppressed because one or more lines are too long

View File

@ -98,11 +98,11 @@ module spine.threejs {
}
end () {
this.vertexBuffer.needsUpdate = true;
this.vertexBuffer.needsUpdate = this.verticesLength > 0;
this.vertexBuffer.updateRange.offset = 0;
this.vertexBuffer.updateRange.count = this.verticesLength;
let geo = (<THREE.BufferGeometry>this.geometry);
geo.getIndex().needsUpdate = true;
geo.getIndex().needsUpdate = this.indicesLength > 0;
geo.getIndex().updateRange.offset = 0;
geo.getIndex().updateRange.count = this.indicesLength;
geo.drawRange.start = 0;