Sfoglia il codice sorgente

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

trethaller 7 anni fa
parent
commit
8c697e59d5
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  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();
 				tmpBuf = new hxd.FloatBuffer();
 			else
 			else
 				PREV_BUFFER = null;
 				PREV_BUFFER = null;
-			#if hl
 			if( isStatic )
 			if( isStatic )
-			#end
 				tmpBuf.grow(65535 * stride);
 				tmpBuf.grow(65535 * stride);
 		}
 		}
+		if( !isStatic )
+			tmpBuf.grow(vcount * stride + bufPos);
 		if( tmpIdx == null ) {
 		if( tmpIdx == null ) {
 			tmpIdx = PREV_INDEX;
 			tmpIdx = PREV_INDEX;
 			if( tmpIdx == null )
 			if( tmpIdx == null )