metal macOS配置描述符的storageMode

时间:2017-07-26 21:46:05

标签: ios xcode macos applet metal

我在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'**

有谁知道如何设置配置存储模式?

1 个答案:

答案 0 :(得分:0)

在Swift中,它是MTLStorageMode.private.private,可以进行类型推断。