diff options
author | Michael Jones <michael_p_jones@apple.com> | 2021-12-08 18:07:11 +0300 |
---|---|---|
committer | Michael Jones <michael_p_jones@apple.com> | 2021-12-08 18:08:12 +0300 |
commit | e23b54a59f0428399bbf4de5ba007ad764fa80be (patch) | |
tree | ae2910fbd1582d952ee1c3dfe959b94227e06832 /intern/cycles/device/metal/device_impl.mm | |
parent | 5e9dba822d8de977909bf170dcae9950535e01af (diff) |
Cycles: Fix OS version warnings
This patch suppresses OS version warnings and hides currently unsupported Metal GPUs when enumerating devices.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D13506
Diffstat (limited to 'intern/cycles/device/metal/device_impl.mm')
-rw-r--r-- | intern/cycles/device/metal/device_impl.mm | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/intern/cycles/device/metal/device_impl.mm b/intern/cycles/device/metal/device_impl.mm index fd249204646..4ad5a3caebc 100644 --- a/intern/cycles/device/metal/device_impl.mm +++ b/intern/cycles/device/metal/device_impl.mm @@ -308,14 +308,12 @@ bool MetalDevice::load_kernels(const uint _kernel_features) MTLCompileOptions *options = [[MTLCompileOptions alloc] init]; options.fastMathEnabled = YES; - options.languageVersion = MTLLanguageVersion2_1; - - if (@available(macOS 11.0, *)) { - options.languageVersion = MTLLanguageVersion2_3; - } if (@available(macOS 12.0, *)) { options.languageVersion = MTLLanguageVersion2_4; } + else { + return false; + } string metalsrc; @@ -925,12 +923,14 @@ void MetalDevice::tex_alloc(device_texture &mem) } } - /* Optimize the texture for GPU access. */ - id<MTLCommandBuffer> commandBuffer = [mtlGeneralCommandQueue commandBuffer]; - id<MTLBlitCommandEncoder> blitCommandEncoder = [commandBuffer blitCommandEncoder]; - [blitCommandEncoder optimizeContentsForGPUAccess:mtlTexture]; - [blitCommandEncoder endEncoding]; - [commandBuffer commit]; + if (@available(macos 10.14, *)) { + /* Optimize the texture for GPU access. */ + id<MTLCommandBuffer> commandBuffer = [mtlGeneralCommandQueue commandBuffer]; + id<MTLBlitCommandEncoder> blitCommandEncoder = [commandBuffer blitCommandEncoder]; + [blitCommandEncoder optimizeContentsForGPUAccess:mtlTexture]; + [blitCommandEncoder endEncoding]; + [commandBuffer commit]; + } /* Set Mapping and tag that we need to (re-)upload to device */ texture_slot_map[slot] = mtlTexture; |