There is an MTLLanguageVersion
enum documented at https://developer.apple.com/documentation/metal/mtllanguageversion?language=objc which, if I understand correctly, returns current Metal shading language version at runtime.
The problem is, I can't figure out where to retrieve it. I can't find any related property on MTLDevice or some global function for this, and documentation doesn't help either.
MTLLanguageVersion enum is used for configuring one of the compiler options, namely, languageVersion.
You can configure the Metal compiler’s options by setting any or all of an MTLCompileOptions instance’s properties, including the following:
- Target previous OS releases by assigning the languageVersion property to an MTLLanguageVersion case.
You can compile a library with your compile options instance by calling a
MTLDevice
instance’snewLibraryWithSource:options:error:
ornewLibraryWithSource:options:completionHandler:
method.