diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-10-19 21:31:12 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-10-19 21:34:53 +0300 |
commit | 193b456d2db87ac578a4dae25d654454ea0c03a0 (patch) | |
tree | ac8caa8d976baca2be5c2985fa409042cd80b583 /intern/cycles/device | |
parent | c3d0ba3b333cb9cf09c94932edd98ae74d0b06a4 (diff) |
Fix macOS build error after recent changes to enable Intel GPUs
This will only work once we upgrade to the macOS 13 SDK.
Ref D16253
Diffstat (limited to 'intern/cycles/device')
-rw-r--r-- | intern/cycles/device/metal/device_impl.mm | 2 | ||||
-rw-r--r-- | intern/cycles/device/metal/util.mm | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/intern/cycles/device/metal/device_impl.mm b/intern/cycles/device/metal/device_impl.mm index 82ad5d55ecd..4ec0ea065ab 100644 --- a/intern/cycles/device/metal/device_impl.mm +++ b/intern/cycles/device/metal/device_impl.mm @@ -339,11 +339,13 @@ bool MetalDevice::compile_and_load(MetalPipelineType pso_type) MTLCompileOptions *options = [[MTLCompileOptions alloc] init]; +#if defined(MAC_OS_VERSION_13_0) if (@available(macos 13.0, *)) { if (device_vendor == METAL_GPU_INTEL) { [options setOptimizationLevel:MTLLibraryOptimizationLevelSize]; } } +#endif options.fastMathEnabled = YES; if (@available(macOS 12.0, *)) { diff --git a/intern/cycles/device/metal/util.mm b/intern/cycles/device/metal/util.mm index eb77aeb6a54..63f84a9df33 100644 --- a/intern/cycles/device/metal/util.mm +++ b/intern/cycles/device/metal/util.mm @@ -110,9 +110,11 @@ vector<id<MTLDevice>> const &MetalInfo::get_usable_devices() usable |= (vendor == METAL_GPU_AMD); } +#if defined(MAC_OS_VERSION_13_0) if (@available(macos 13.0, *)) { usable |= (vendor == METAL_GPU_INTEL); } +#endif if (usable) { metal_printf("- %s\n", device_name.c_str()); |