let oneEyeWidth: CGFloat = 1920
let oneEyeHeight: CGFloat = 2160
let resizedBuffer = filter.resizeFrame(sourcePixelFrame: pixelBuffer,
targetSize: MTLSize.init(width: oneEyeWidth*2, height: oneEyeHeight, depth: 0),
resizeMode: .scaleToFill) {
The original pixelBuffer size is (1920, 2160) and I want to stretch it into (3840, 2160).
And it crashed with error:
-[MTLDebugBlitCommandEncoder validateCopyFromTexture:sourceSlice:sourceLevel:sourceOrigin:sourceSize:toBuffer
:destinationOffset:destinationBytesPerRow:destinationBytesPerImage:options:]
:1015: failed assertion `Copy From Buffer Validation
destinationBytesPerRow(7680) must be >= (15360).
totalBytesUsed(16596480) must be <= [destinationBuffer length](16588800).