2011-04-27 11:58:34 +00:00
|
|
|
|
2011-11-08 20:27:37 +00:00
|
|
|
set(INC
|
|
|
|
.
|
|
|
|
../util
|
|
|
|
osl
|
|
|
|
svm
|
|
|
|
)
|
|
|
|
|
|
|
|
set(SRC
|
2011-04-27 11:58:34 +00:00
|
|
|
kernel.cpp
|
2011-11-15 15:13:38 +00:00
|
|
|
kernel_optimized.cpp
|
2011-04-27 11:58:34 +00:00
|
|
|
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
|
2011-04-27 11:58:34 +00:00
|
|
|
kernel_bvh.h
|
|
|
|
kernel_camera.h
|
|
|
|
kernel_compat_cpu.h
|
|
|
|
kernel_compat_cuda.h
|
|
|
|
kernel_compat_opencl.h
|
|
|
|
kernel_differential.h
|
|
|
|
kernel_displace.h
|
|
|
|
kernel_emission.h
|
|
|
|
kernel_film.h
|
|
|
|
kernel_globals.h
|
|
|
|
kernel_light.h
|
|
|
|
kernel_math.h
|
|
|
|
kernel_mbvh.h
|
|
|
|
kernel_montecarlo.h
|
|
|
|
kernel_object.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
|
2012-05-07 20:37:48 +00:00
|
|
|
kernel_projection.h
|
2011-04-27 11:58:34 +00:00
|
|
|
kernel_qbvh.h
|
|
|
|
kernel_random.h
|
|
|
|
kernel_shader.h
|
2011-05-20 12:26:01 +00:00
|
|
|
kernel_textures.h
|
2011-04-27 11:58:34 +00:00
|
|
|
kernel_triangle.h
|
2011-11-08 20:27:37 +00:00
|
|
|
kernel_types.h
|
|
|
|
)
|
2011-05-20 12:26:01 +00:00
|
|
|
|
2011-11-08 20:27:37 +00:00
|
|
|
set(SRC_SVM_HEADERS
|
2011-04-27 11:58:34 +00:00
|
|
|
svm/bsdf.h
|
|
|
|
svm/bsdf_ashikhmin_velvet.h
|
|
|
|
svm/bsdf_diffuse.h
|
2011-11-14 17:31:47 +00:00
|
|
|
svm/bsdf_oren_nayar.h
|
2011-04-27 11:58:34 +00:00
|
|
|
svm/bsdf_microfacet.h
|
|
|
|
svm/bsdf_reflection.h
|
|
|
|
svm/bsdf_refraction.h
|
|
|
|
svm/bsdf_transparent.h
|
|
|
|
svm/bsdf_ward.h
|
|
|
|
svm/bsdf_westin.h
|
|
|
|
svm/emissive.h
|
|
|
|
svm/svm.h
|
|
|
|
svm/svm_attribute.h
|
|
|
|
svm/svm_bsdf.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
|
2011-04-27 11:58:34 +00:00
|
|
|
svm/svm_displace.h
|
|
|
|
svm/svm_fresnel.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
|
2011-12-01 21:46:10 +00:00
|
|
|
svm/svm_sepcomb_rgb.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
|
|
|
|
svm/svm_voronoi.h
|
2011-11-06 21:05:58 +00:00
|
|
|
svm/svm_wave.h
|
2011-04-27 11:58:34 +00:00
|
|
|
svm/volume.h
|
2011-11-08 20:27:37 +00:00
|
|
|
)
|
2011-04-27 11:58:34 +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
|
|
|
|
../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)
|
|
|
|
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
|
|
|
|
set(CUDA_BITS 64)
|
|
|
|
else()
|
|
|
|
set(CUDA_BITS 32)
|
|
|
|
endif()
|
|
|
|
|
2012-02-23 15:10:10 +00:00
|
|
|
set(cuda_sources kernel.cu ${SRC_HEADERS} ${SRC_SVM_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)
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${cuda_cubin}
|
|
|
|
COMMAND ${CUDA_NVCC_EXECUTABLE} -arch=${arch} -m${CUDA_BITS} --cubin ${CMAKE_CURRENT_SOURCE_DIR}/kernel.cu --use_fast_math -o ${CMAKE_CURRENT_BINARY_DIR}/${cuda_cubin} --ptxas-options="-v" --maxrregcount=24 --opencc-options -OPT:Olimit=0 -I${CMAKE_CURRENT_SOURCE_DIR}/../util -I${CMAKE_CURRENT_SOURCE_DIR}/svm -DCCL_NAMESPACE_BEGIN= -DCCL_NAMESPACE_END= -DNVCC
|
|
|
|
DEPENDS ${cuda_sources})
|
|
|
|
|
|
|
|
delayed_install("${CMAKE_CURRENT_BINARY_DIR}" "${cuda_cubin}" ${CYCLES_INSTALL_PATH}/lib)
|
|
|
|
list(APPEND cuda_cubins ${cuda_cubin})
|
|
|
|
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)
|
|
|
|
endif()
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
# CPU module
|
|
|
|
|
2011-11-08 20:27:37 +00:00
|
|
|
include_directories(${INC})
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-11-08 20:27:37 +00:00
|
|
|
add_library(cycles_kernel ${SRC} ${SRC_HEADERS} ${SRC_SVM_HEADERS})
|
2011-04-28 13:47:27 +00:00
|
|
|
|
2011-11-15 15:13:38 +00:00
|
|
|
if(WITH_CYCLES_OPTIMIZED_KERNEL)
|
2011-12-07 08:03:52 +00:00
|
|
|
set_source_files_properties(kernel_optimized.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_OPTIMIZED_KERNEL_FLAGS}")
|
2011-11-15 15:13:38 +00:00
|
|
|
endif()
|
|
|
|
|
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)
|
|
|
|
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_SVM_HEADERS}" ${CYCLES_INSTALL_PATH}/kernel/svm)
|
|
|
|
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_UTIL_HEADERS}" ${CYCLES_INSTALL_PATH}/kernel)
|
2011-11-15 15:13:38 +00:00
|
|
|
|