【问题标题】:Detecting GPU family 3 on iOS reliably at run time在运行时可靠地检测 iOS 上的 GPU 系列 3
【发布时间】:2020-11-11 16:03:24
【问题描述】:

我在代码中使用这个函数来检测 A9 或更高版本的设备:

    public static var gpuFamily3AndHigh:Bool = {
      return ARConfiguration.isSupported //Hack to know A9 or more
    }

但现在 Apple 拒绝了该代码,因为该应用没有 ARKit 功能。在 iOS 13 和 iOS 12 上如何在不使用 ARKit 的情况下识别它。在 iOS 13 上,我知道我可以做到:

  public static var gpuFamily3AndHigh:Bool = {
   // return ARConfiguration.isSupported //Hack to know A9 or more
    
    guard let device = MTLCreateSystemDefaultDevice() else { return false }
    
    return device.supportsFamily(.apple3)
}()

但我不知道 .apple3 是否比 .common3 是正确的常量,以及我在 iOS 12 上该怎么办?

【问题讨论】:

    标签: ios swift arkit metal metalkit


    【解决方案1】:

    如果我正确阅读了this document,您应该在 API 可用时检查支持的系列(如您所做的那样),否则返回检查特定功能集。

    如果你真的想专门检查 A9 及更高版本,家庭.apple3 和功能集.iOS_GPUFamily3_v1 似乎是要走的路。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-04-21
      • 1970-01-01
      • 1970-01-01
      • 2015-04-23
      • 1970-01-01
      • 1970-01-01
      • 2011-06-21
      • 2013-11-19
      相关资源
      最近更新 更多