From 3f96555123db2b48047c40a45a6b78d6cd760dc4 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 13 Dec 2021 13:48:36 +0100 Subject: 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 --- intern/cycles/cmake/external_libs.cmake | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'intern/cycles/cmake/external_libs.cmake') 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() -- cgit v1.2.3