This project is an example: How to Use Metal to resize CVPixelBuffer on the GPU.
-
Create MTLTexture from CVPixelBuffer
-
MPSImageBilinearScale shaders scale texture for
scaleToFill\scaleAspectFit\ scaleAspectFillmode -
Copy MTLTexture to MTLBuffer
-
Create CVPixelBuffer from MTLBuffer