Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt5
-rw-r--r--build_files/cmake/config/blender_release.cmake1
-rw-r--r--intern/cycles/cmake/external_libs.cmake13
-rw-r--r--release/scripts/startup/bl_ui/space_userpref.py6
4 files changed, 19 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 59d07fd1a74..5c5b5eb317e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -463,6 +463,11 @@ if(NOT APPLE)
mark_as_advanced(CYCLES_HIP_BINARIES_ARCH)
endif()
+# Apple Metal
+if(APPLE)
+ option(WITH_CYCLES_DEVICE_METAL "Enable Cycles Apple Metal compute support" ON)
+endif()
+
# Draw Manager
option(WITH_DRAW_DEBUG "Add extra debug capabilities to Draw Manager" OFF)
mark_as_advanced(WITH_DRAW_DEBUG)
diff --git a/build_files/cmake/config/blender_release.cmake b/build_files/cmake/config/blender_release.cmake
index 04074db688d..da8724071b7 100644
--- a/build_files/cmake/config/blender_release.cmake
+++ b/build_files/cmake/config/blender_release.cmake
@@ -61,6 +61,7 @@ set(WITH_MEM_JEMALLOC ON CACHE BOOL "" FORCE)
# platform dependent options
if(APPLE)
set(WITH_COREAUDIO ON CACHE BOOL "" FORCE)
+ set(WITH_CYCLES_DEVICE_METAL ON CACHE BOOL "" FORCE)
endif()
if(NOT WIN32)
set(WITH_JACK ON CACHE BOOL "" FORCE)
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()
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 4976834dd87..6dbb964e771 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -596,9 +596,11 @@ class USERPREF_PT_system_cycles_devices(SystemPanel, CenterAlignMixIn, Panel):
@classmethod
def poll(cls, _context):
- # No GPU rendering on macOS currently.
+ # No GPU rendering on macOS x86_64 currently.
+ import platform
import sys
- return bpy.app.build_options.cycles and sys.platform != "darwin"
+ return bpy.app.build_options.cycles and \
+ (sys.platform != "darwin" or platform.machine() == "arm64")
def draw_centered(self, context, layout):
prefs = context.preferences