Compiling and running the metal examples

寵の児 提交于 2019-12-05 00:08:58
James Campbell

You can't run metal on simulator but you can use this workaround so that it will still compile as long as you have a fallback for the code.

http://medium.com/@jscampbell/bare-metal-working-with-metal-and-the-simulator-70e085e3a45

According to a staff on Apple dev forums, Metal does not run in the simulator.

See: https://devforums.apple.com/message/971605#971605

If you look at other samples/app templates there is no need to explicitly link any framework, indeed everything runs out of the box.

I started with the hello triangle example they give you to download. It contains all the platform #if's you need to know about. I recommend you get that project and take a look.

https://developer.apple.com/documentation/metal/hello_triangle

#if TARGET_OS_SIMULATOR
#error No simulator support for Metal API.  Must build for a device
#endif
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!