如何指定Metal Shader语言版本? [英] How to specify Metal Shader Language version?

查看:244
本文介绍了如何指定Metal Shader语言版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序第三次获得Binary Rejected.崩溃日志没有帮助(我已将其符号化,但是它们不包含任何打印日志...).

My app got Binary Rejected for the third time. The crashlogs are no help (I've symbolized them, but they do not contain any print logs...).

iPhone 6siPhone XiPad Pro 12.9

我正在使用目标为iOS 11

由于iOS版Metal无法在模拟器中运行,因此我尚未在iOS 11

As Metal for iOS can not be run in the simulator, I have not tested on iOS 11

所以我得到了Crashlytics并获得了crash_info_entry_0键的一些信息:

So I got Crashlytics and got some info for the crash_info_entry_0 key:

... Error Domain = AGXMetalA8X代码= 3函数...使用的语言版本为2.1与此操作系统不兼容." ...

...Error Domain=AGXMetalA8X Code=3 "Function ... is using language version 2.1 which is incompatible with this OS."...

它发生在运行iOS 11.4.1

所以我想问题是iOS 11不支持Metal language version 2.1

So I guess the problem is that iOS 11 dose not support Metal language version 2.1

如何将语言版本更改为2.0?

How do I change the language version to 2.0?

更新1:

检查我的金属库后,确实确实将目标设置为iOS 12.应用目标为iOS 11时运行良好.我现在已经将Metal Lib目标更改为iOS 11,希望也能更改Metal Language版本...

After checking my Metal Lib, it did indeed have a target of iOS 12. Tho it ran fine with app target of iOS 11. I've now changed the Metal Lib target to iOS 11, I hope that changes the Metal Language Version too...

我希望编译器或App Store上载器能够抓住这一点.

I wish the Compiler or App Store Uploader would catch this.

更新2:

成功了!更改Metal Lib的iOS版本目标也会更改Metal Shader Language版本.

It worked! Changing the iOS version target of the Metal Lib also changes the Metal Shader Language version.

推荐答案

在包含金属代码的目标中,有一个名为金属语言修订版"的构建设置(实际键为MTL_LANGUAGE_REVISION,有效值包括Metal20,分别对应于语言版本1.2和2.0),可让您指定首选的MSL版本.如果未设置,则此设置选择适合于当前SDK和部署目标的默认值,在您的情况下似乎过于激进了.如果您不使用MSL 2.1功能,则可以在目标设置的构建设置"部分中将其明确设置为金属2.0".

In targets that contain Metal code, there is a build setting called "Metal language revision" (the actual key is MTL_LANGUAGE_REVISION, and valid values include Metal12 and Metal20, corresponding to language versions 1.2 and 2.0, respectively) that allows you to specify your preferred MSL version. When not set, this setting choses a default that is suitable for the current SDK and deployment target, which seems to be overly aggressive in your case. If you aren't using MSL 2.1 features, you can explicitly set this to "Metal 2.0" in the Build Settings section of your target's settings.

这篇关于如何指定Metal Shader语言版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆