Fix: only use preserveInvariance for Z fighting when supported by macOS

Pull Request: https://projects.blender.org/blender/blender/pulls/117484
This commit is contained in:
Brecht Van Lommel 2024-01-24 18:30:26 +01:00 committed by Brecht Van Lommel
parent 6fc7f99a95
commit ae27daf834
1 changed files with 2 additions and 1 deletions

View File

@ -314,9 +314,10 @@ bool MTLShader::finalize(const shader::ShaderCreateInfo *info)
MTLCompileOptions *options = [[[MTLCompileOptions alloc] init] autorelease];
options.languageVersion = MTLLanguageVersion2_2;
options.fastMathEnabled = YES;
options.preserveInvariance = YES;
if (@available(macOS 11.00, *)) {
options.preserveInvariance = YES;
/* Raster order groups for tile data in struct require Metal 2.3.
* Retaining Metal 2.2. for old shaders to maintain backwards
* compatibility for existing features. */