Browse Source

DX12 : Fix int overflow

TothBenoit 5 tháng trước cách đây
mục cha
commit
cbb3feac33
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      h3d/impl/DX12Driver.hx

+ 1 - 1
h3d/impl/DX12Driver.hx

@@ -124,7 +124,7 @@ class BumpAllocator {
 		var newOffset = size + offsetAligned;
 		if ( newOffset > capacity ) {
 			if ( next == null )
-				next = new BumpAllocator(Std.int(capacity*3/2));
+				next = new BumpAllocator(hxd.Math.imax(Std.int(capacity*3/2), size));
 			return next.tryAlloc(size, alignment, allocation);
 		}
 		allocation.byteSize = size;