我几乎可以在标题中表达我想说的话!
MTLCompileOptions
(https://developer.apple.com/documentation/metal/mtlcompileoptions), MTLLanguageVersion
(https://developer.apple.com/documentation/metal/mtllanguageversion) 可以指定。这允许您在编译 Metal 时指定 Metal 版本号。
这次得到的知识是,为了在Objective-C中编译包含MTLLanguageVersion3_0
和在Swift中包含MTLLanguageVersion.version3_0
的代码没有错误,升级到macOS Ventura 13是不够的,需要使用Xcode 14.1来解决。
另外,由于 MTLLanguageVersion3_0
在 Objective-C 中被声明为宏,我们可以通过使用 #ifdef
来确定它是否被定义。
原创声明:本文系作者授权爱码网发表,未经许可,不得转载;
原文地址:https://www.likecs.com/show-308632071.html