How to specify Metal Shader Language version?
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...).
Runs fine on
iPhone X and
iPad Pro 12.9
I'm testing on
iOS 12 with app target
As Metal for iOS can not be run in the simulator, I have not tested on
So I got Crashlytics and got some info for the
...Error Domain=AGXMetalA8X Code=3 "Function ... is using language version 2.1 which is incompatible with this OS."...
It occurred on an
iPad Air 2 (A8) running
So I guess the problem is that
iOS 11 dose not support Metal
language version 2.1
How do I change the language version to
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...
I wish the Compiler or App Store Uploader would catch this.
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
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.