gpt4 book ai didi

ios - 是否可以在 iPad Swift Playground 中使用 Metal 着色器代码?

转载 作者:可可西里 更新时间:2023-11-01 04:37:18 25 4
gpt4 key购买 nike

是否可以在 iPad Swift Playground 中使用自定义 Metal 着色器代码?

如果是这样,如何将 *.metal 文件或代码(或其预编译对象)放到 iPad 上以与 Playground 和 Swift 代码一起使用?在 Mac 上使用 Xcode 是否需要帮助?

(这个问题不是关于使用内置性能着色器,也不是关于在 Mac 上的 Playground 中运行东西)

最佳答案

你有两个选择:要么在 Xcode 中创建一个 iOS Playground ,然后将它发送到你的 iPad,但你不能编辑 .metal 文件,只能阅读它,就像 this example 中那样。 ;或者您可以将着色器文件创建为多行字符串(现在可以在 Swift 4 和 Xcode 9 beta 中使用)并从该字符串创建您的库。一种更麻烦的方法是像 this example 那样在 Xcode 8/Swift 3 中连接字符串行.

关于ios - 是否可以在 iPad Swift Playground 中使用 Metal 着色器代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44682638/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com