Allocating memory for data used by MTLBuffer in iOS Metal
问题 As a follow-up question to this answer. I am trying to replace a for-loop running on CPU with a kernel function in Metal to parallelize computation and speed up performance. My function is basically a convolution. Since I repeatedly receive new data for my input array values (the data stems from a AVCaptureSession ) it seems that using newBufferWithBytesNoCopy:length:options:deallocator: is the sensible option for creating the MTLBuffer objects. Here is the relevant code: id <MTLBuffer>