我正在尝试使用运行 iOS 10.3 的 iPad 使用 Google 的 Liquidfun 和 Metal 进行一些流体模拟。但是,对 MTLCreateSystemDefaultDevice() 的初始调用返回 nil。
我有以下控制台日志,所以我知道 iPad 支持 Metal,但我不确定如何调试此问题。
2018-07-02 20:28:44.547645-0500 chem-lab-practical[529:464344] [DYMTLInitPlatform].
platform initialization successful 2018-07-02 20:28:44.781763-0500
chem-lab-practical[529:464294] Metal GPU Frame Capture Enabled 2018-07-02
20:28:44.783609-0500 chem-lab-practical[529:464294] Metal API Validation Enabled
(lldb)
我还没有发现关于堆栈溢出的类似问题并且是使用 Metal 的初学者,所以我不确定如何开始调试这个问题。
最佳答案
所以...我想我看起来还不够努力,因为我在这里找到了答案 ( iOS code to identify metal support in runtime? )。
根据帖子,
Note that just testing for the presence of a Metal framework class doesn't help — those classes are there on any device running iOS 8 (all the way back to iPhone 4s & iPad 2), regardless of whether that device has a Metal-capable GPU.
作为引用,这是兼容 Metal 的 iOS 设备列表 ( https://developer.apple.com/library/archive/documentation/DeviceInformation/Reference/iOSDeviceCompatibility/HardwareGPUInformation/HardwareGPUInformation.html )
关于swift - MTLCreateSystemDefaultDevice() 在装有 iOS 10.3 的 iPad 上返回 nil,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51145594/