swift - MTLCreateSystemDefaultDevice() 在装有 iOS 10.3 的 iPad 上返回 nil

标签 swift metal

我正在尝试使用运行 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/

相关文章:

iOS Metal - 当发送到片段着色器时,带有 [[position]] 限定符的位置会发生什么?

metal - 如何使用 Metal Shader Lanuage 计算 16 channel 图像的均值和方差值

objective-c - 在单个 MTLRenderCommandEncoder : How to Synchronize MTLBuffer? 中使用多个渲染管道

ios - iOS Metal的MTLTexture中的depth和arrayLength有什么区别

ios - 如何将 ScnNode 用作 ScnLight?

iOS swift : function not returning correct value

swift - 覆盖 Swift 2 中的函数错误

ios - 将 CollectionView 连接到 ViewController,连接 dataSource-Swift-XCode 时出错

ios - 如何使用 Metal 自定义计算着色器并获得非常流畅的性能?

ios - 如何在不旋转 map 的情况下将 GoogleMaps 居中?