从另一个项目访问自定义金属库
Accessing a custom Metal library from another project
我希望在 Xcode 中创建自己的 Metal 库目标。 makeLibrary(filepath:)
描述了 here requires a file with the .metallib extension. Do I have to create the .metallib file manually using each of the metal files in the Metal library target as described here 并在运行时加载它?或者我可以将它以某种方式嵌入到我的应用程序中以允许在编译时编译着色器吗?第一种策略似乎效率低下,目标一定有一些用处。
我没有找到更好的方法告诉 Xcode 将 metallib
嵌入我的其他目标(在我的例子中是一个框架),所以我在我的框架中设置了一个自定义构建阶段目标是像这样复制库:
我还将 Metal 库目标添加为我的框架目标的依赖项,以确保它始终先构建。
我希望在 Xcode 中创建自己的 Metal 库目标。 makeLibrary(filepath:)
描述了 here requires a file with the .metallib extension. Do I have to create the .metallib file manually using each of the metal files in the Metal library target as described here 并在运行时加载它?或者我可以将它以某种方式嵌入到我的应用程序中以允许在编译时编译着色器吗?第一种策略似乎效率低下,目标一定有一些用处。
我没有找到更好的方法告诉 Xcode 将 metallib
嵌入我的其他目标(在我的例子中是一个框架),所以我在我的框架中设置了一个自定义构建阶段目标是像这样复制库:
我还将 Metal 库目标添加为我的框架目标的依赖项,以确保它始终先构建。