问题描述
我正在使用Xcode 11 GM Seed(11A419c).当我在iOS 13模拟器上运行Metal代码并尝试访问使用MTLCreateSystemDefaultDevice()创建的Metal设备时,它返回nil.在没有此设备的情况下,Metal如何在模拟器上运行? XCode中是否有任何设置可以解决?如果有的话,我有运行Mac OS 10.14.6的Macbook Pro retina 2012模型.
I am using Xcode 11 GM Seed (11A419c). When I run Metal code on iOS 13 simulator and try to access metal device created using MTLCreateSystemDefaultDevice(), it returns nil. How is Metal supposed to run on simulator without this device? Is there any setting in XCode to fix it? I have Macbook Pro retina 2012 model running Mac OS 10.14.6 if that matters.
推荐答案
仅当在macOS Catalina(10.15)或更高版本上运行时,金属才可在iOS 13和tvOS 13模拟器中使用. Xcode 11发行说明中对此进行了记录.
Metal is available in iOS 13 and tvOS 13 simulators only when running on macOS Catalina (10.15) or later. This is documented in the Xcode 11 Release Notes.
这篇关于MTLCreateSystemDefaultDevice在iOS 13模拟器上返回nil的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!