Skip to content

Commit

Permalink
Upgrade VAF to not split up un-indexed verts into 64k chunks.
Browse files Browse the repository at this point in the history
  • Loading branch information
emackey committed Apr 9, 2015
1 parent 4adcff3 commit 1bdcab5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/Renderer/VertexArrayFacade.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ define([
destroyVA(this);
var va = this.va = [];

var numberOfVertexArrays = Math.ceil(this._size / CesiumMath.SIXTY_FOUR_KILOBYTES);
var numberOfVertexArrays = defined(indexBuffer) ? Math.ceil(this._size / CesiumMath.SIXTY_FOUR_KILOBYTES) : 1;
for ( var k = 0; k < numberOfVertexArrays; ++k) {
var attributes = [];
for (var usage in buffersByUsage) {
Expand All @@ -340,7 +340,7 @@ define([
va.push({
va : this._context.createVertexArray(attributes, indexBuffer),
indicesCount : 1.5 * ((k !== (numberOfVertexArrays - 1)) ? CesiumMath.SIXTY_FOUR_KILOBYTES : (this._size % CesiumMath.SIXTY_FOUR_KILOBYTES))
// TODO: not hardcode 1.5
// TODO: not hardcode 1.5, this assumes 6 indicies per 4 vertices (as for Billboard quads).
});
}
}
Expand Down

0 comments on commit 1bdcab5

Please sign in to comment.