diff options
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/kernel/CMakeLists.txt | 20 | ||||
-rw-r--r-- | intern/cycles/kernel/SConscript | 5 | ||||
-rw-r--r-- | intern/cycles/kernel/geom/geom_bvh.h (renamed from intern/cycles/kernel/kernel_bvh.h) | 28 | ||||
-rw-r--r-- | intern/cycles/kernel/geom/geom_bvh_subsurface.h (renamed from intern/cycles/kernel/kernel_bvh_subsurface.h) | 0 | ||||
-rw-r--r-- | intern/cycles/kernel/geom/geom_bvh_traversal.h (renamed from intern/cycles/kernel/kernel_bvh_traversal.h) | 0 | ||||
-rw-r--r-- | intern/cycles/kernel/geom/geom_curve.h (renamed from intern/cycles/kernel/kernel_curve.h) | 0 | ||||
-rw-r--r-- | intern/cycles/kernel/geom/geom_object.h (renamed from intern/cycles/kernel/kernel_object.h) | 0 | ||||
-rw-r--r-- | intern/cycles/kernel/geom/geom_triangle.h (renamed from intern/cycles/kernel/kernel_triangle.h) | 0 | ||||
-rw-r--r-- | intern/cycles/kernel/kernel_path.h | 9 | ||||
-rw-r--r-- | intern/cycles/kernel/osl/osl_services.cpp | 9 | ||||
-rw-r--r-- | intern/cycles/kernel/osl/osl_shader.cpp | 3 |
11 files changed, 41 insertions, 33 deletions
diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt index ebeebe20c0f..ccefb314894 100644 --- a/intern/cycles/kernel/CMakeLists.txt +++ b/intern/cycles/kernel/CMakeLists.txt @@ -19,14 +19,10 @@ set(SRC set(SRC_HEADERS kernel.h kernel_accumulate.h - kernel_bvh.h - kernel_bvh_subsurface.h - kernel_bvh_traversal.h kernel_camera.h kernel_compat_cpu.h kernel_compat_cuda.h kernel_compat_opencl.h - kernel_curve.h kernel_differential.h kernel_displace.h kernel_emission.h @@ -36,7 +32,6 @@ set(SRC_HEADERS kernel_light.h kernel_math.h kernel_montecarlo.h - kernel_object.h kernel_passes.h kernel_path.h kernel_path_state.h @@ -47,7 +42,6 @@ set(SRC_HEADERS kernel_shadow.h kernel_subsurface.h kernel_textures.h - kernel_triangle.h kernel_types.h kernel_volume.h ) @@ -114,6 +108,15 @@ set(SRC_SVM_HEADERS svm/svm_wave.h ) +set(SRC_GEOM_HEADERS + geom/geom_bvh.h + geom/geom_bvh_subsurface.h + geom/geom_bvh_traversal.h + geom/geom_curve.h + geom/geom_object.h + geom/geom_triangle.h +) + set(SRC_UTIL_HEADERS ../util/util_color.h ../util/util_half.h @@ -146,7 +149,7 @@ if(WITH_CYCLES_CUDA_BINARIES) endif() # build for each arch - set(cuda_sources kernel.cu ${SRC_HEADERS} ${SRC_SVM_HEADERS} ${SRC_CLOSURE_HEADERS} ${SRC_UTIL_HEADERS}) + set(cuda_sources kernel.cu ${SRC_HEADERS} ${SRC_SVM_HEADERS} ${SRC_GEOM_HEADERS} ${SRC_CLOSURE_HEADERS} ${SRC_UTIL_HEADERS}) set(cuda_cubins) foreach(arch ${CYCLES_CUDA_BINARIES_ARCH}) @@ -222,7 +225,7 @@ if(CXX_HAS_SSE) endif() -add_library(cycles_kernel ${SRC} ${SRC_HEADERS} ${SRC_CLOSURE_HEADERS} ${SRC_SVM_HEADERS}) +add_library(cycles_kernel ${SRC} ${SRC_HEADERS} ${SRC_CLOSURE_HEADERS} ${SRC_SVM_HEADERS} ${SRC_GEOM_HEADERS}) if(WITH_CYCLES_CUDA) add_dependencies(cycles_kernel cycles_kernel_cuda) @@ -243,5 +246,6 @@ delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernel.cu" ${CYCLES_INSTALL_PATH}/k delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_HEADERS}" ${CYCLES_INSTALL_PATH}/kernel) delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_CLOSURE_HEADERS}" ${CYCLES_INSTALL_PATH}/kernel/closure) delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_SVM_HEADERS}" ${CYCLES_INSTALL_PATH}/kernel/svm) +delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_GEOM_HEADERS}" ${CYCLES_INSTALL_PATH}/kernel/geom) delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_UTIL_HEADERS}" ${CYCLES_INSTALL_PATH}/kernel) diff --git a/intern/cycles/kernel/SConscript b/intern/cycles/kernel/SConscript index 5077d8c96b0..b2eafe6a83d 100644 --- a/intern/cycles/kernel/SConscript +++ b/intern/cycles/kernel/SConscript @@ -60,6 +60,7 @@ if env['WITH_BF_CYCLES_CUDA_BINARIES']: kernel_file = os.path.join(source_dir, "kernel.cu") util_dir = os.path.join(source_dir, "../util") svm_dir = os.path.join(source_dir, "../svm") + geom_dir = os.path.join(source_dir, "../geom") closure_dir = os.path.join(source_dir, "../closure") # get CUDA version @@ -76,10 +77,10 @@ if env['WITH_BF_CYCLES_CUDA_BINARIES']: nvcc_flags += " --cubin --ptxas-options=\"-v\"" nvcc_flags += " -D__KERNEL_CUDA_VERSION__=%d" % (cuda_version) nvcc_flags += " -DCCL_NAMESPACE_BEGIN= -DCCL_NAMESPACE_END= -DNVCC" - nvcc_flags += " -I \"%s\" -I \"%s\" -I \"%s\"" % (util_dir, svm_dir, closure_dir) + nvcc_flags += " -I \"%s\" -I \"%s\" -I \"%s\"" % (util_dir, svm_dir, geom_dir, closure_dir) # dependencies - dependencies = ['kernel.cu'] + kernel.Glob('*.h') + kernel.Glob('../util/*.h') + kernel.Glob('svm/*.h') + kernel.Glob('closure/*.h') + dependencies = ['kernel.cu'] + kernel.Glob('*.h') + kernel.Glob('../util/*.h') + kernel.Glob('svm/*.h') + kernel.Glob('geom/*.h') + kernel.Glob('closure/*.h') last_cubin_file = None # add command for each cuda architecture diff --git a/intern/cycles/kernel/kernel_bvh.h b/intern/cycles/kernel/geom/geom_bvh.h index 942c7abce65..0272dff5115 100644 --- a/intern/cycles/kernel/kernel_bvh.h +++ b/intern/cycles/kernel/geom/geom_bvh.h @@ -15,8 +15,6 @@ * limitations under the License. */ -CCL_NAMESPACE_BEGIN - /* * "Persistent while-while kernel" used in: * @@ -42,6 +40,12 @@ CCL_NAMESPACE_BEGIN #define NO_EXTENDED_PRECISION volatile #endif +#include "geom_object.h" +#include "geom_curve.h" +#include "geom_triangle.h" + +CCL_NAMESPACE_BEGIN + ccl_device_inline float3 bvh_inverse_direction(float3 dir) { /* avoid divide by zero (ooeps = exp2f(-80.0f)) */ @@ -884,60 +888,60 @@ ccl_device_inline void bvh_triangle_intersect_subsurface(KernelGlobals *kg, Inte #define BVH_FUNCTION_NAME bvh_intersect #define BVH_FUNCTION_FEATURES 0 -#include "kernel_bvh_traversal.h" +#include "geom_bvh_traversal.h" #if defined(__INSTANCING__) #define BVH_FUNCTION_NAME bvh_intersect_instancing #define BVH_FUNCTION_FEATURES BVH_INSTANCING -#include "kernel_bvh_traversal.h" +#include "geom_bvh_traversal.h" #endif #if defined(__HAIR__) #define BVH_FUNCTION_NAME bvh_intersect_hair #define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR|BVH_HAIR_MINIMUM_WIDTH -#include "kernel_bvh_traversal.h" +#include "geom_bvh_traversal.h" #endif #if defined(__OBJECT_MOTION__) #define BVH_FUNCTION_NAME bvh_intersect_motion #define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_MOTION -#include "kernel_bvh_traversal.h" +#include "geom_bvh_traversal.h" #endif #if defined(__HAIR__) && defined(__OBJECT_MOTION__) #define BVH_FUNCTION_NAME bvh_intersect_hair_motion #define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR|BVH_HAIR_MINIMUM_WIDTH|BVH_MOTION -#include "kernel_bvh_traversal.h" +#include "geom_bvh_traversal.h" #endif #if defined(__SUBSURFACE__) #define BVH_FUNCTION_NAME bvh_intersect_subsurface #define BVH_FUNCTION_FEATURES 0 -#include "kernel_bvh_subsurface.h" +#include "geom_bvh_subsurface.h" #endif #if defined(__SUBSURFACE__) && defined(__INSTANCING__) #define BVH_FUNCTION_NAME bvh_intersect_subsurface_instancing #define BVH_FUNCTION_FEATURES BVH_INSTANCING -#include "kernel_bvh_subsurface.h" +#include "geom_bvh_subsurface.h" #endif #if defined(__SUBSURFACE__) && defined(__HAIR__) #define BVH_FUNCTION_NAME bvh_intersect_subsurface_hair #define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR -#include "kernel_bvh_subsurface.h" +#include "geom_bvh_subsurface.h" #endif #if defined(__SUBSURFACE__) && defined(__OBJECT_MOTION__) #define BVH_FUNCTION_NAME bvh_intersect_subsurface_motion #define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_MOTION -#include "kernel_bvh_subsurface.h" +#include "geom_bvh_subsurface.h" #endif #if defined(__SUBSURFACE__) && defined(__HAIR__) && defined(__OBJECT_MOTION__) #define BVH_FUNCTION_NAME bvh_intersect_subsurface_hair_motion #define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR|BVH_MOTION -#include "kernel_bvh_subsurface.h" +#include "geom_bvh_subsurface.h" #endif /* to work around titan bug when using arrays instead of textures */ diff --git a/intern/cycles/kernel/kernel_bvh_subsurface.h b/intern/cycles/kernel/geom/geom_bvh_subsurface.h index 40683a2da57..40683a2da57 100644 --- a/intern/cycles/kernel/kernel_bvh_subsurface.h +++ b/intern/cycles/kernel/geom/geom_bvh_subsurface.h diff --git a/intern/cycles/kernel/kernel_bvh_traversal.h b/intern/cycles/kernel/geom/geom_bvh_traversal.h index 0515a9e0fa7..0515a9e0fa7 100644 --- a/intern/cycles/kernel/kernel_bvh_traversal.h +++ b/intern/cycles/kernel/geom/geom_bvh_traversal.h diff --git a/intern/cycles/kernel/kernel_curve.h b/intern/cycles/kernel/geom/geom_curve.h index 821ac50eaa9..821ac50eaa9 100644 --- a/intern/cycles/kernel/kernel_curve.h +++ b/intern/cycles/kernel/geom/geom_curve.h diff --git a/intern/cycles/kernel/kernel_object.h b/intern/cycles/kernel/geom/geom_object.h index a66277e10cd..a66277e10cd 100644 --- a/intern/cycles/kernel/kernel_object.h +++ b/intern/cycles/kernel/geom/geom_object.h diff --git a/intern/cycles/kernel/kernel_triangle.h b/intern/cycles/kernel/geom/geom_triangle.h index 0455df85961..0455df85961 100644 --- a/intern/cycles/kernel/kernel_triangle.h +++ b/intern/cycles/kernel/geom/geom_triangle.h diff --git a/intern/cycles/kernel/kernel_path.h b/intern/cycles/kernel/kernel_path.h index 81b61a54a6a..9b3ddbb7557 100644 --- a/intern/cycles/kernel/kernel_path.h +++ b/intern/cycles/kernel/kernel_path.h @@ -18,16 +18,15 @@ #include "osl_shader.h" #endif +#include "kernel_random.h" + +#include "geom/geom_bvh.h" + #include "kernel_differential.h" #include "kernel_montecarlo.h" #include "kernel_projection.h" -#include "kernel_object.h" -#include "kernel_triangle.h" -#include "kernel_curve.h" #include "kernel_primitive.h" #include "kernel_projection.h" -#include "kernel_random.h" -#include "kernel_bvh.h" #include "kernel_accumulate.h" #include "kernel_camera.h" #include "kernel_shader.h" diff --git a/intern/cycles/kernel/osl/osl_services.cpp b/intern/cycles/kernel/osl/osl_services.cpp index 58858c3766e..a25d2fe03b5 100644 --- a/intern/cycles/kernel/osl/osl_services.cpp +++ b/intern/cycles/kernel/osl/osl_services.cpp @@ -30,14 +30,13 @@ #include "kernel_compat_cpu.h" #include "kernel_globals.h" +#include "kernel_random.h" + +#include "geom/geom_bvh.h" + #include "kernel_montecarlo.h" #include "kernel_projection.h" #include "kernel_differential.h" -#include "kernel_object.h" -#include "kernel_random.h" -#include "kernel_bvh.h" -#include "kernel_triangle.h" -#include "kernel_curve.h" #include "kernel_primitive.h" #include "kernel_projection.h" #include "kernel_accumulate.h" diff --git a/intern/cycles/kernel/osl/osl_shader.cpp b/intern/cycles/kernel/osl/osl_shader.cpp index 554f647df7c..34d9ebefdb3 100644 --- a/intern/cycles/kernel/osl/osl_shader.cpp +++ b/intern/cycles/kernel/osl/osl_shader.cpp @@ -18,7 +18,8 @@ #include "kernel_montecarlo.h" #include "kernel_types.h" #include "kernel_globals.h" -#include "kernel_object.h" + +#include "geom/geom_object.h" #include "closure/bsdf_diffuse.h" #include "closure/bssrdf.h" |