Browse Source

bugfix 8 bytes alignment on streaming data

ncannasse 6 năm trước cách đây
mục cha
commit
4fa49fbce1
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      h3d/impl/GlDriver.hx

+ 2 - 1
h3d/impl/GlDriver.hx

@@ -1097,10 +1097,11 @@ class GlDriver extends Driver {
 		#if hl
 		var needed = streamPos + length;
 		var total = (needed + 7) & ~7; // align on 8 bytes
+		var alen = total - streamPos;
 		if( total > streamLen ) expandStream(total);
 		streamBytes.blit(streamPos, data, pos, length);
 		data = streamBytes.offset(streamPos);
-		streamPos = total;
+		streamPos += alen;
 		#end
 		return data;
 	}