我在macOS上尝试了MetalImageRecognition示例。
可是:
**failed assertion `[MPSTemporaryImage prefetchStorageWithCommandBuffer:imageDescriptorList:] Error: the descriptor must be configured with MTLStorageModePrivate'**
运行时
MPSTemporaryImage.prefetchStorage(with: commandBuffer, imageDescriptorList: [sid, inid, m0id, m1id, m2id, m3id, m4id, m5id, m6id, m7id, m8id, m9id, m10id])
我查看了官方文档并尝试将模式设置为私有模式:
let sid = MPSImageDescriptor(channelFormat: textureFormat, width: 299, height: 299, featureChannels: 3, **storageMode: MTLStorageModePrivate**)
但
**Use of unresolved identifier 'MTLStorageModePrivate'**
有谁知道如何设置配置存储模式?
答案 0 :(得分:0)
在Swift中,它是MTLStorageMode.private
或.private
,可以进行类型推断。