diff options
author | Michael Jones <michael_p_jones@apple.com> | 2021-12-07 18:11:35 +0300 |
---|---|---|
committer | Michael Jones <michael_p_jones@apple.com> | 2021-12-07 18:52:21 +0300 |
commit | 9558fa5196033390111a2348caa66ab18b8a4f89 (patch) | |
tree | acc3ed446f709390abfef5f97f82c1ed9abe0100 /intern/cycles/device/CMakeLists.txt | |
parent | 565b33c0ad31966b860123837d2c4b5a8cbedad2 (diff) |
Cycles: Metal host-side code
This patch adds the Metal host-side code:
- Add all core host-side Metal backend files (device_impl, queue, etc)
- Add MetalRT BVH setup files
- Integrate with Cycles device enumeration code
- Revive `path_source_replace_includes` in util/path (required for MSL compilation)
This patch also includes a couple of small kernel-side fixes:
- Add an implementation of `lgammaf` for Metal [Nemes, Gergő (2010), "New asymptotic expansion for the Gamma function", Archiv der Mathematik](https://users.renyi.hu/~gergonemes/)
- include "work_stealing.h" inside the Metal context class because it accesses state now
Ref T92212
Reviewed By: brecht
Maniphest Tasks: T92212
Differential Revision: https://developer.blender.org/D13423
Diffstat (limited to 'intern/cycles/device/CMakeLists.txt')
-rw-r--r-- | intern/cycles/device/CMakeLists.txt | 49 |
1 files changed, 38 insertions, 11 deletions
diff --git a/intern/cycles/device/CMakeLists.txt b/intern/cycles/device/CMakeLists.txt index 99b1fc8135d..7f1e9ff3d0f 100644 --- a/intern/cycles/device/CMakeLists.txt +++ b/intern/cycles/device/CMakeLists.txt @@ -43,7 +43,7 @@ if(WITH_CYCLES_DEVICE_HIP AND WITH_HIP_DYNLOAD) add_definitions(-DWITH_HIP_DYNLOAD) endif() -set(SRC +set(SRC_BASE device.cpp denoise.cpp graphics_interop.cpp @@ -104,6 +104,21 @@ set(SRC_MULTI multi/device.h ) +set(SRC_METAL + metal/bvh.mm + metal/bvh.h + metal/device.mm + metal/device.h + metal/device_impl.mm + metal/device_impl.h + metal/kernel.mm + metal/kernel.h + metal/queue.mm + metal/queue.h + metal/util.mm + metal/util.h +) + set(SRC_OPTIX optix/device.cpp optix/device.h @@ -123,6 +138,17 @@ set(SRC_HEADERS queue.h ) +set(SRC + ${SRC_BASE} + ${SRC_CPU} + ${SRC_CUDA} + ${SRC_HIP} + ${SRC_DUMMY} + ${SRC_MULTI} + ${SRC_OPTIX} + ${SRC_HEADERS} +) + set(LIB cycles_kernel cycles_util @@ -158,6 +184,15 @@ endif() if(WITH_CYCLES_DEVICE_OPTIX) add_definitions(-DWITH_OPTIX) endif() +if(WITH_CYCLES_DEVICE_METAL) + list(APPEND LIB + ${METAL_LIBRARY} + ) + add_definitions(-DWITH_METAL) + list(APPEND SRC + ${SRC_METAL} + ) +endif() if(WITH_OPENIMAGEDENOISE) list(APPEND LIB @@ -168,20 +203,12 @@ endif() include_directories(${INC}) include_directories(SYSTEM ${INC_SYS}) -cycles_add_library(cycles_device "${LIB}" - ${SRC} - ${SRC_CPU} - ${SRC_CUDA} - ${SRC_HIP} - ${SRC_DUMMY} - ${SRC_MULTI} - ${SRC_OPTIX} - ${SRC_HEADERS} -) +cycles_add_library(cycles_device "${LIB}" ${SRC}) source_group("cpu" FILES ${SRC_CPU}) source_group("cuda" FILES ${SRC_CUDA}) source_group("dummy" FILES ${SRC_DUMMY}) source_group("multi" FILES ${SRC_MULTI}) +source_group("metal" FILES ${SRC_METAL}) source_group("optix" FILES ${SRC_OPTIX}) source_group("common" FILES ${SRC} ${SRC_HEADERS}) |