mirror of
https://github.com/blender/blender
synced 2026-10-25 03:07:01 +03:00
Split the device-specific logic into individual files that reside in kernel/device/<device>. Should be no functional change, but it should make it easier to work with individual devices easier. Some minor changes compared to prior to this change: - There is an explicit target cycles_kernel_cpu. It makes it easier pass header dependencies to GPU backends, but also makes it possible to only try compile CPU kernels when GPU binaries are enabled. - There is a CMake option to allow building different device backends in parallel: WITH_CYCLES_PARALLEL_DEVICE_KERNEL_BUILD. It is set to OFF by default, matching old behavior. Setting it to ON helps in situations when memory is not a concern, or when it is only a couple of GPU architectures enabled. Pull Request: https://projects.blender.org/blender/blender/pulls/152241
45 lines
986 B
CMake
45 lines
986 B
CMake
# SPDX-FileCopyrightText: 2011-2026 Blender Foundation
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
set(INC
|
|
../../..
|
|
)
|
|
|
|
set(INC_SYS
|
|
|
|
)
|
|
|
|
set(SRC_KERNEL_DEVICE_METAL
|
|
kernel.metal
|
|
)
|
|
|
|
set(SRC_KERNEL_DEVICE_METAL_HEADERS
|
|
bvh.h
|
|
compat.h
|
|
context_begin.h
|
|
context_end.h
|
|
function_constants.h
|
|
globals.h
|
|
)
|
|
|
|
|
|
set(LIB
|
|
|
|
)
|
|
|
|
if(WITH_CYCLES_DEVICE_METAL)
|
|
add_library(cycles_kernel_metal INTERFACE)
|
|
target_sources(cycles_kernel_metal INTERFACE
|
|
${SRC_KERNEL_DEVICE_METAL}
|
|
${SRC_KERNEL_DEVICE_METAL_HEADERS}
|
|
)
|
|
cycles_set_solution_folder(cycles_kernel_metal)
|
|
|
|
source_group("device\\metal" FILES ${SRC_KERNEL_DEVICE_METAL} ${SRC_KERNEL_DEVICE_METAL_HEADERS})
|
|
|
|
add_dependencies(cycles_kernel cycles_kernel_metal)
|
|
endif()
|
|
|
|
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_KERNEL_DEVICE_METAL}" ${CYCLES_INSTALL_PATH}/source/kernel/device/metal)
|
|
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_KERNEL_DEVICE_METAL_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel/device/metal)
|