2011-04-27 11:58:34 +00:00
|
|
|
|
2011-11-08 20:27:37 +00:00
|
|
|
set(INC
|
|
|
|
.
|
|
|
|
../util
|
|
|
|
osl
|
|
|
|
svm
|
|
|
|
)
|
2012-10-17 04:13:03 +00:00
|
|
|
|
2012-09-20 09:04:43 +00:00
|
|
|
set(INC_SYS
|
2012-10-17 04:13:03 +00:00
|
|
|
|
2012-09-20 09:04:43 +00:00
|
|
|
)
|
2011-11-08 20:27:37 +00:00
|
|
|
|
|
|
|
set(SRC
|
2011-04-27 11:58:34 +00:00
|
|
|
kernel.cpp
|
|
|
|
kernel.cl
|
2011-11-08 20:27:37 +00:00
|
|
|
kernel.cu
|
|
|
|
)
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-11-08 20:27:37 +00:00
|
|
|
set(SRC_HEADERS
|
2011-04-27 11:58:34 +00:00
|
|
|
kernel.h
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
kernel_accumulate.h
|
2014-05-19 12:57:55 +00:00
|
|
|
kernel_bake.h
|
2011-04-27 11:58:34 +00:00
|
|
|
kernel_camera.h
|
|
|
|
kernel_compat_cpu.h
|
|
|
|
kernel_compat_cuda.h
|
|
|
|
kernel_compat_opencl.h
|
|
|
|
kernel_differential.h
|
|
|
|
kernel_emission.h
|
|
|
|
kernel_film.h
|
|
|
|
kernel_globals.h
|
2013-06-07 16:06:22 +00:00
|
|
|
kernel_jitter.h
|
2011-04-27 11:58:34 +00:00
|
|
|
kernel_light.h
|
|
|
|
kernel_math.h
|
|
|
|
kernel_montecarlo.h
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
kernel_passes.h
|
2011-04-27 11:58:34 +00:00
|
|
|
kernel_path.h
|
2013-09-08 18:59:39 +00:00
|
|
|
kernel_path_state.h
|
2014-04-04 12:35:30 +00:00
|
|
|
kernel_path_surface.h
|
|
|
|
kernel_path_volume.h
|
2012-05-07 20:37:48 +00:00
|
|
|
kernel_projection.h
|
2011-04-27 11:58:34 +00:00
|
|
|
kernel_random.h
|
|
|
|
kernel_shader.h
|
2013-12-28 01:56:53 +00:00
|
|
|
kernel_shadow.h
|
2013-04-01 20:26:52 +00:00
|
|
|
kernel_subsurface.h
|
2011-05-20 12:26:01 +00:00
|
|
|
kernel_textures.h
|
2011-11-08 20:27:37 +00:00
|
|
|
kernel_types.h
|
2013-12-28 15:56:19 +00:00
|
|
|
kernel_volume.h
|
2011-11-08 20:27:37 +00:00
|
|
|
)
|
2011-05-20 12:26:01 +00:00
|
|
|
|
2012-10-20 14:08:49 +00:00
|
|
|
set(SRC_CLOSURE_HEADERS
|
2012-10-20 12:18:00 +00:00
|
|
|
closure/bsdf.h
|
|
|
|
closure/bsdf_ashikhmin_velvet.h
|
2012-10-20 14:08:49 +00:00
|
|
|
closure/bsdf_diffuse.h
|
2012-12-11 14:39:41 +00:00
|
|
|
closure/bsdf_diffuse_ramp.h
|
2012-10-20 12:18:00 +00:00
|
|
|
closure/bsdf_microfacet.h
|
2012-10-20 14:08:49 +00:00
|
|
|
closure/bsdf_oren_nayar.h
|
2012-11-06 19:59:07 +00:00
|
|
|
closure/bsdf_phong_ramp.h
|
2012-10-20 12:18:00 +00:00
|
|
|
closure/bsdf_reflection.h
|
|
|
|
closure/bsdf_refraction.h
|
2012-12-19 21:17:16 +00:00
|
|
|
closure/bsdf_toon.h
|
2012-10-20 12:18:00 +00:00
|
|
|
closure/bsdf_transparent.h
|
2012-12-15 10:18:42 +00:00
|
|
|
closure/bsdf_util.h
|
2014-06-08 10:16:28 +00:00
|
|
|
closure/bsdf_ashikhmin_shirley.h
|
2012-10-20 12:18:00 +00:00
|
|
|
closure/bsdf_westin.h
|
2013-09-15 23:58:00 +00:00
|
|
|
closure/bsdf_hair.h
|
2013-04-01 20:26:52 +00:00
|
|
|
closure/bssrdf.h
|
2012-10-20 12:18:00 +00:00
|
|
|
closure/emissive.h
|
|
|
|
closure/volume.h
|
2012-10-20 14:08:49 +00:00
|
|
|
)
|
|
|
|
set(SRC_SVM_HEADERS
|
2011-04-27 11:58:34 +00:00
|
|
|
svm/svm.h
|
|
|
|
svm/svm_attribute.h
|
2013-06-15 23:47:09 +00:00
|
|
|
svm/svm_blackbody.h
|
2011-12-02 20:36:13 +00:00
|
|
|
svm/svm_camera.h
|
2011-04-27 11:58:34 +00:00
|
|
|
svm/svm_closure.h
|
|
|
|
svm/svm_convert.h
|
2012-01-08 14:55:43 +00:00
|
|
|
svm/svm_checker.h
|
2012-09-04 13:29:07 +00:00
|
|
|
svm/svm_brick.h
|
2011-04-27 11:58:34 +00:00
|
|
|
svm/svm_displace.h
|
|
|
|
svm/svm_fresnel.h
|
2013-05-20 15:58:37 +00:00
|
|
|
svm/svm_wireframe.h
|
2013-06-09 20:46:22 +00:00
|
|
|
svm/svm_wavelength.h
|
2011-12-16 20:35:06 +00:00
|
|
|
svm/svm_gamma.h
|
2012-01-24 16:32:31 +00:00
|
|
|
svm/svm_brightness.h
|
2011-04-27 11:58:34 +00:00
|
|
|
svm/svm_geometry.h
|
2011-11-06 21:05:58 +00:00
|
|
|
svm/svm_gradient.h
|
2011-12-02 16:57:37 +00:00
|
|
|
svm/svm_hsv.h
|
2011-04-27 11:58:34 +00:00
|
|
|
svm/svm_image.h
|
2011-12-03 23:05:35 +00:00
|
|
|
svm/svm_invert.h
|
2011-04-27 11:58:34 +00:00
|
|
|
svm/svm_light_path.h
|
|
|
|
svm/svm_magic.h
|
|
|
|
svm/svm_mapping.h
|
|
|
|
svm/svm_math.h
|
|
|
|
svm/svm_mix.h
|
|
|
|
svm/svm_musgrave.h
|
|
|
|
svm/svm_noise.h
|
|
|
|
svm/svm_noisetex.h
|
2011-12-16 18:15:07 +00:00
|
|
|
svm/svm_normal.h
|
2012-03-26 12:45:14 +00:00
|
|
|
svm/svm_ramp.h
|
2013-07-03 23:46:56 +00:00
|
|
|
svm/svm_sepcomb_hsv.h
|
2014-06-14 10:28:49 +00:00
|
|
|
svm/svm_sepcomb_vector.h
|
2011-04-27 11:58:34 +00:00
|
|
|
svm/svm_sky.h
|
|
|
|
svm/svm_tex_coord.h
|
|
|
|
svm/svm_texture.h
|
|
|
|
svm/svm_types.h
|
|
|
|
svm/svm_value.h
|
2013-06-23 17:51:08 +00:00
|
|
|
svm/svm_vector_transform.h
|
2011-04-27 11:58:34 +00:00
|
|
|
svm/svm_voronoi.h
|
2011-11-06 21:05:58 +00:00
|
|
|
svm/svm_wave.h
|
2011-11-08 20:27:37 +00:00
|
|
|
)
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2014-03-29 12:03:45 +00:00
|
|
|
set(SRC_GEOM_HEADERS
|
2014-03-29 12:03:48 +00:00
|
|
|
geom/geom.h
|
|
|
|
geom/geom_attribute.h
|
2014-03-29 12:03:45 +00:00
|
|
|
geom/geom_bvh.h
|
|
|
|
geom/geom_bvh_subsurface.h
|
|
|
|
geom/geom_bvh_traversal.h
|
|
|
|
geom/geom_curve.h
|
2014-03-29 12:03:47 +00:00
|
|
|
geom/geom_motion_curve.h
|
2014-03-29 12:03:47 +00:00
|
|
|
geom/geom_motion_triangle.h
|
2014-03-29 12:03:45 +00:00
|
|
|
geom/geom_object.h
|
2014-03-29 12:03:48 +00:00
|
|
|
geom/geom_primitive.h
|
2014-03-29 12:03:45 +00:00
|
|
|
geom/geom_triangle.h
|
2014-03-29 12:03:48 +00:00
|
|
|
geom/geom_volume.h
|
2014-03-29 12:03:45 +00:00
|
|
|
)
|
|
|
|
|
2011-11-08 20:27:37 +00:00
|
|
|
set(SRC_UTIL_HEADERS
|
2011-08-11 12:36:08 +00:00
|
|
|
../util/util_color.h
|
2014-01-15 14:29:22 +00:00
|
|
|
../util/util_half.h
|
2011-08-11 12:36:08 +00:00
|
|
|
../util/util_math.h
|
|
|
|
../util/util_transform.h
|
2011-11-08 20:27:37 +00:00
|
|
|
../util/util_types.h
|
|
|
|
)
|
2011-11-10 12:52:17 +00:00
|
|
|
# CUDA module
|
|
|
|
|
|
|
|
if(WITH_CYCLES_CUDA_BINARIES)
|
2013-06-19 17:54:23 +00:00
|
|
|
# 32 bit or 64 bit
|
2011-11-10 12:52:17 +00:00
|
|
|
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
|
|
|
|
set(CUDA_BITS 64)
|
|
|
|
else()
|
|
|
|
set(CUDA_BITS 32)
|
|
|
|
endif()
|
|
|
|
|
2013-06-19 17:54:23 +00:00
|
|
|
# CUDA version
|
|
|
|
execute_process (COMMAND ${CUDA_NVCC_EXECUTABLE} "--version" OUTPUT_VARIABLE NVCC_OUT)
|
|
|
|
string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\1" CUDA_VERSION_MAJOR ${NVCC_OUT})
|
|
|
|
string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR ${NVCC_OUT})
|
|
|
|
set(CUDA_VERSION "${CUDA_VERSION_MAJOR}${CUDA_VERSION_MINOR}")
|
|
|
|
|
2013-06-20 13:10:47 +00:00
|
|
|
# warn for other versions
|
2014-04-30 08:54:17 +00:00
|
|
|
if(CUDA_VERSION MATCHES "60")
|
2013-06-20 13:10:47 +00:00
|
|
|
else()
|
2014-03-13 12:31:06 +00:00
|
|
|
message(WARNING
|
|
|
|
"CUDA version ${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR} detected, "
|
2014-04-30 08:54:17 +00:00
|
|
|
"build may succeed but only CUDA 6.0 is officially supported")
|
2013-06-20 13:10:47 +00:00
|
|
|
endif()
|
|
|
|
|
2013-06-19 17:54:23 +00:00
|
|
|
# build for each arch
|
2014-03-29 12:03:45 +00:00
|
|
|
set(cuda_sources kernel.cu ${SRC_HEADERS} ${SRC_SVM_HEADERS} ${SRC_GEOM_HEADERS} ${SRC_CLOSURE_HEADERS} ${SRC_UTIL_HEADERS})
|
2011-11-10 12:52:17 +00:00
|
|
|
set(cuda_cubins)
|
|
|
|
|
|
|
|
foreach(arch ${CYCLES_CUDA_BINARIES_ARCH})
|
|
|
|
set(cuda_cubin kernel_${arch}.cubin)
|
|
|
|
|
2013-06-19 17:54:23 +00:00
|
|
|
set(cuda_version_flags "-D__KERNEL_CUDA_VERSION__=${CUDA_VERSION}")
|
2013-10-08 15:29:28 +00:00
|
|
|
set(cuda_math_flags "--use_fast_math")
|
2014-04-30 08:54:17 +00:00
|
|
|
|
|
|
|
if(CUDA_VERSION LESS 60 AND ${arch} MATCHES "sm_50")
|
|
|
|
message(WARNING "Can't build kernel for CUDA sm_50 architecture, skipping")
|
|
|
|
elseif(CUDA_VERSION LESS 50 AND ${arch} MATCHES "sm_35")
|
2013-06-20 13:10:47 +00:00
|
|
|
message(WARNING "Can't build kernel for CUDA sm_35 architecture, skipping")
|
|
|
|
else()
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${cuda_cubin}
|
2014-03-13 12:31:06 +00:00
|
|
|
COMMAND ${CUDA_NVCC_EXECUTABLE}
|
|
|
|
-arch=${arch}
|
|
|
|
-m${CUDA_BITS}
|
|
|
|
--cubin ${CMAKE_CURRENT_SOURCE_DIR}/kernel.cu
|
|
|
|
-o ${CMAKE_CURRENT_BINARY_DIR}/${cuda_cubin}
|
|
|
|
--ptxas-options="-v"
|
|
|
|
${cuda_arch_flags}
|
|
|
|
${cuda_version_flags}
|
|
|
|
${cuda_math_flags}
|
|
|
|
-I${CMAKE_CURRENT_SOURCE_DIR}/../util
|
|
|
|
-I${CMAKE_CURRENT_SOURCE_DIR}/svm
|
|
|
|
-DCCL_NAMESPACE_BEGIN=
|
|
|
|
-DCCL_NAMESPACE_END=
|
|
|
|
-DNVCC
|
|
|
|
|
2013-06-20 13:10:47 +00:00
|
|
|
DEPENDS ${cuda_sources})
|
2011-11-10 12:52:17 +00:00
|
|
|
|
2013-06-20 13:10:47 +00:00
|
|
|
delayed_install("${CMAKE_CURRENT_BINARY_DIR}" "${cuda_cubin}" ${CYCLES_INSTALL_PATH}/lib)
|
|
|
|
list(APPEND cuda_cubins ${cuda_cubin})
|
|
|
|
endif()
|
2011-11-10 12:52:17 +00:00
|
|
|
endforeach()
|
|
|
|
|
|
|
|
add_custom_target(cycles_kernel_cuda ALL DEPENDS ${cuda_cubins})
|
|
|
|
endif()
|
2011-08-11 12:36:08 +00:00
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
# OSL module
|
|
|
|
|
2011-08-16 16:15:34 +00:00
|
|
|
if(WITH_CYCLES_OSL)
|
|
|
|
add_subdirectory(osl)
|
2012-11-03 14:32:13 +00:00
|
|
|
add_subdirectory(shaders)
|
2011-08-16 16:15:34 +00:00
|
|
|
endif()
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
# CPU module
|
|
|
|
|
2011-11-08 20:27:37 +00:00
|
|
|
include_directories(${INC})
|
2012-09-20 09:04:43 +00:00
|
|
|
include_directories(SYSTEM ${INC_SYS})
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2014-03-26 23:15:36 +00:00
|
|
|
if(CXX_HAS_SSE)
|
|
|
|
list(APPEND SRC
|
|
|
|
kernel_sse2.cpp
|
|
|
|
kernel_sse3.cpp
|
|
|
|
kernel_sse41.cpp
|
|
|
|
kernel_avx.cpp
|
2014-06-13 20:23:58 +00:00
|
|
|
kernel_avx2.cpp
|
2014-03-26 23:15:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
set_source_files_properties(kernel_sse2.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE2_KERNEL_FLAGS}")
|
|
|
|
set_source_files_properties(kernel_sse3.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE3_KERNEL_FLAGS}")
|
|
|
|
set_source_files_properties(kernel_sse41.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE41_KERNEL_FLAGS}")
|
|
|
|
set_source_files_properties(kernel_avx.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX_KERNEL_FLAGS}")
|
2014-06-13 20:23:58 +00:00
|
|
|
set_source_files_properties(kernel_avx2.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX2_KERNEL_FLAGS}")
|
2014-03-26 23:15:36 +00:00
|
|
|
endif()
|
|
|
|
|
2013-11-22 13:16:47 +00:00
|
|
|
|
2014-03-29 12:03:45 +00:00
|
|
|
add_library(cycles_kernel ${SRC} ${SRC_HEADERS} ${SRC_CLOSURE_HEADERS} ${SRC_SVM_HEADERS} ${SRC_GEOM_HEADERS})
|
2013-11-22 13:16:47 +00:00
|
|
|
|
2011-08-16 16:15:34 +00:00
|
|
|
if(WITH_CYCLES_CUDA)
|
|
|
|
add_dependencies(cycles_kernel cycles_kernel_cuda)
|
|
|
|
endif()
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-11-15 15:13:38 +00:00
|
|
|
# OpenCL kernel
|
2011-05-20 12:26:01 +00:00
|
|
|
|
2011-11-08 20:27:37 +00:00
|
|
|
#set(KERNEL_PREPROCESSED ${CMAKE_CURRENT_BINARY_DIR}/kernel_preprocessed.cl)
|
2011-09-02 14:55:06 +00:00
|
|
|
#add_custom_command(
|
2011-11-08 20:27:37 +00:00
|
|
|
# OUTPUT ${KERNEL_PREPROCESSED}
|
2011-12-20 17:36:56 +00:00
|
|
|
# COMMAND gcc -x c++ -E ${CMAKE_CURRENT_SOURCE_DIR}/kernel.cl -I ${CMAKE_CURRENT_SOURCE_DIR}/../util/ -DCCL_NAMESPACE_BEGIN= -DCCL_NAMESPACE_END= -o ${KERNEL_PREPROCESSED}
|
2011-11-08 20:27:37 +00:00
|
|
|
# DEPENDS ${SRC_KERNEL} ${SRC_UTIL_HEADERS})
|
|
|
|
#add_custom_target(cycles_kernel_preprocess ALL DEPENDS ${KERNEL_PREPROCESSED})
|
|
|
|
#delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${KERNEL_PREPROCESSED}" ${CYCLES_INSTALL_PATH}/kernel)
|
2011-09-02 14:55:06 +00:00
|
|
|
|
|
|
|
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernel.cl" ${CYCLES_INSTALL_PATH}/kernel)
|
2011-09-09 12:04:39 +00:00
|
|
|
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernel.cu" ${CYCLES_INSTALL_PATH}/kernel)
|
2011-11-08 20:27:37 +00:00
|
|
|
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_HEADERS}" ${CYCLES_INSTALL_PATH}/kernel)
|
2012-10-20 14:08:49 +00:00
|
|
|
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_CLOSURE_HEADERS}" ${CYCLES_INSTALL_PATH}/kernel/closure)
|
2011-11-08 20:27:37 +00:00
|
|
|
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_SVM_HEADERS}" ${CYCLES_INSTALL_PATH}/kernel/svm)
|
2014-03-29 12:03:45 +00:00
|
|
|
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_GEOM_HEADERS}" ${CYCLES_INSTALL_PATH}/kernel/geom)
|
2011-11-08 20:27:37 +00:00
|
|
|
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_UTIL_HEADERS}" ${CYCLES_INSTALL_PATH}/kernel)
|
2011-11-15 15:13:38 +00:00
|
|
|
|