浏览代码

BigPrimitive optim: avoid big alloc when !static on all targets

trethaller 7 年之前
父节点
当前提交
8c697e59d5
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      h3d/prim/BigPrimitive.hx

+ 2 - 2
h3d/prim/BigPrimitive.hx

@@ -54,11 +54,11 @@ class BigPrimitive extends Primitive {
 				tmpBuf = new hxd.FloatBuffer();
 			else
 				PREV_BUFFER = null;
-			#if hl
 			if( isStatic )
-			#end
 				tmpBuf.grow(65535 * stride);
 		}
+		if( !isStatic )
+			tmpBuf.grow(vcount * stride + bufPos);
 		if( tmpIdx == null ) {
 			tmpIdx = PREV_INDEX;
 			if( tmpIdx == null )