From 1bdcab5608ccb385443c6f78a18cb31c878cb917 Mon Sep 17 00:00:00 2001 From: Ed Mackey Date: Thu, 9 Apr 2015 16:40:19 -0400 Subject: [PATCH] Upgrade VAF to not split up un-indexed verts into 64k chunks. --- Source/Renderer/VertexArrayFacade.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Renderer/VertexArrayFacade.js b/Source/Renderer/VertexArrayFacade.js index 44510f76aeaf..26eebc179785 100644 --- a/Source/Renderer/VertexArrayFacade.js +++ b/Source/Renderer/VertexArrayFacade.js @@ -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) { @@ -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). }); } }