给 ComputeShader class 增加以下三个方法:
// 从 OpenCV Mat 创建(只读的) Metal Texture
- (id<MTLTexture>) textureFromCVMat:(const void*)cv_data Width:(int) w Height:(int)h {
// Create a Metal texture descriptor
MTLTextureDescriptor *textureDescriptor = [MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatR8Unorm
width:w
height:h
mipmapped:NO];