diff options
author | Brecht Van Lommel <brecht> | 2021-12-13 15:48:36 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-12-13 15:57:13 +0300 |
commit | 3f96555123db2b48047c40a45a6b78d6cd760dc4 (patch) | |
tree | 711738d87051eb16eec538a0fa2d8116fc0f5336 /intern/cycles/cmake/external_libs.cmake | |
parent | 8ba63026964bce2b8e454f50766627ce629a0da4 (diff) |
Cycles: enable Metal GPU rendering
This adds the remaining bits to enable Metal on macOS. There are still
performance optimizations and other improvements planned, but it should
now be ready for early testing.
This is currently only enabled on in Arm builds for M1 GPUs. It is not
yet working on AMD or Intel GPUs.
Ref T92212
Differential Revision: https://developer.blender.org/D13503
Diffstat (limited to 'intern/cycles/cmake/external_libs.cmake')
-rw-r--r-- | intern/cycles/cmake/external_libs.cmake | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake index 9967a775184..f46d18a4926 100644 --- a/intern/cycles/cmake/external_libs.cmake +++ b/intern/cycles/cmake/external_libs.cmake @@ -556,12 +556,17 @@ endif() ########################################################################### if(WITH_CYCLES_DEVICE_METAL) - FIND_LIBRARY(METAL_LIBRARY Metal) - if (METAL_LIBRARY) - message(STATUS "Found Metal: ${METAL_LIBRARY}") - else() + find_library(METAL_LIBRARY Metal) + + # This file was added in the 12.0 SDK, use it as a way to detect the version. + if (METAL_LIBRARY AND NOT EXISTS "${METAL_LIBRARY}/Headers/MTLFunctionStitching.h") + message(STATUS "Metal version too old, must be SDK 12.0 or newer, disabling WITH_CYCLES_DEVICE_METAL") + set(WITH_CYCLES_DEVICE_METAL OFF) + elseif (NOT METAL_LIBRARY) message(STATUS "Metal not found, disabling WITH_CYCLES_DEVICE_METAL") set(WITH_CYCLES_DEVICE_METAL OFF) + else() + message(STATUS "Found Metal: ${METAL_LIBRARY}") endif() endif() |