Cycles: Move BVK kernel files to own directory
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 11 Jul 2016 10:28:45 +0000 (12:28 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 11 Jul 2016 11:58:47 +0000 (13:58 +0200)
BVH traversal is not really that much a geometry and we've got
quite some traversals now. Makes sense to keep them separate in
the name of source structure clarity.

19 files changed:
intern/cycles/kernel/CMakeLists.txt
intern/cycles/kernel/bvh/bvh.h [moved from intern/cycles/kernel/geom/geom_bvh.h with 94% similarity]
intern/cycles/kernel/bvh/bvh_nodes.h [moved from intern/cycles/kernel/geom/geom_bvh_nodes.h with 100% similarity]
intern/cycles/kernel/bvh/bvh_shadow.h [moved from intern/cycles/kernel/geom/geom_bvh_shadow.h with 99% similarity]
intern/cycles/kernel/bvh/bvh_subsurface.h [moved from intern/cycles/kernel/geom/geom_bvh_subsurface.h with 99% similarity]
intern/cycles/kernel/bvh/bvh_traversal.h [moved from intern/cycles/kernel/geom/geom_bvh_traversal.h with 99% similarity]
intern/cycles/kernel/bvh/bvh_volume.h [moved from intern/cycles/kernel/geom/geom_bvh_volume.h with 99% similarity]
intern/cycles/kernel/bvh/bvh_volume_all.h [moved from intern/cycles/kernel/geom/geom_bvh_volume_all.h with 99% similarity]
intern/cycles/kernel/bvh/qbvh_nodes.h [moved from intern/cycles/kernel/geom/geom_qbvh.h with 100% similarity]
intern/cycles/kernel/bvh/qbvh_shadow.h [moved from intern/cycles/kernel/geom/geom_qbvh_shadow.h with 100% similarity]
intern/cycles/kernel/bvh/qbvh_subsurface.h [moved from intern/cycles/kernel/geom/geom_qbvh_subsurface.h with 100% similarity]
intern/cycles/kernel/bvh/qbvh_traversal.h [moved from intern/cycles/kernel/geom/geom_qbvh_traversal.h with 100% similarity]
intern/cycles/kernel/bvh/qbvh_volume.h [moved from intern/cycles/kernel/geom/geom_qbvh_volume.h with 100% similarity]
intern/cycles/kernel/bvh/qbvh_volume_all.h [moved from intern/cycles/kernel/geom/geom_qbvh_volume_all.h with 100% similarity]
intern/cycles/kernel/geom/geom.h
intern/cycles/kernel/kernel_path.h
intern/cycles/kernel/kernels/opencl/kernel.cl
intern/cycles/kernel/osl/osl_services.cpp
intern/cycles/kernel/split/kernel_split_common.h

index 3c2f774..3f0917b 100644 (file)
@@ -28,6 +28,22 @@ set(SRC
        kernels/cuda/kernel.cu
 )
 
+set(SRC_BVH_HEADERS
+       bvh/bvh.h
+       bvh/bvh_nodes.h
+       bvh/bvh_shadow.h
+       bvh/bvh_subsurface.h
+       bvh/bvh_traversal.h
+       bvh/bvh_volume.h
+       bvh/bvh_volume_all.h
+       bvh/qbvh_nodes.h
+       bvh/qbvh_shadow.h
+       bvh/qbvh_subsurface.h
+       bvh/qbvh_traversal.h
+       bvh/qbvh_volume.h
+       bvh/qbvh_volume_all.h
+)
+
 set(SRC_HEADERS
        kernel_accumulate.h
        kernel_bake.h
@@ -140,24 +156,11 @@ set(SRC_SVM_HEADERS
 set(SRC_GEOM_HEADERS
        geom/geom.h
        geom/geom_attribute.h
-       geom/geom_bvh.h
-       geom/geom_bvh_nodes.h
-       geom/geom_bvh_shadow.h
-       geom/geom_bvh_subsurface.h
-       geom/geom_bvh_traversal.h
-       geom/geom_bvh_volume.h
-       geom/geom_bvh_volume_all.h
        geom/geom_curve.h
        geom/geom_motion_curve.h
        geom/geom_motion_triangle.h
        geom/geom_object.h
        geom/geom_primitive.h
-       geom/geom_qbvh.h
-       geom/geom_qbvh_shadow.h
-       geom/geom_qbvh_subsurface.h
-       geom/geom_qbvh_traversal.h
-       geom/geom_qbvh_volume.h
-       geom/geom_qbvh_volume_all.h
        geom/geom_triangle.h
        geom/geom_triangle_intersect.h
        geom/geom_volume.h
@@ -213,7 +216,14 @@ if(WITH_CYCLES_CUDA_BINARIES)
        endif()
 
        # build for each arch
-       set(cuda_sources kernels/cuda/kernel.cu ${SRC_HEADERS} ${SRC_SVM_HEADERS} ${SRC_GEOM_HEADERS} ${SRC_CLOSURE_HEADERS} ${SRC_UTIL_HEADERS})
+       set(cuda_sources kernels/cuda/kernel.cu
+               ${SRC_HEADERS}
+               ${SRC_BVH_HEADERS}
+               ${SRC_SVM_HEADERS}
+               ${SRC_GEOM_HEADERS}
+               ${SRC_CLOSURE_HEADERS}
+               ${SRC_UTIL_HEADERS}
+       )
        set(cuda_cubins)
 
        macro(CYCLES_CUDA_KERNEL_ADD arch experimental)
@@ -313,6 +323,7 @@ add_library(cycles_kernel
        ${SRC}
        ${SRC_HEADERS}
        ${SRC_KERNELS_CPU_HEADERS}
+       ${SRC_BVH_HEADERS}
        ${SRC_CLOSURE_HEADERS}
        ${SRC_SVM_HEADERS}
        ${SRC_GEOM_HEADERS}
@@ -347,6 +358,7 @@ delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_next_iteratio
 delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_sum_all_radiance.cl" ${CYCLES_INSTALL_PATH}/kernel/kernels/opencl)
 delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/cuda/kernel.cu" ${CYCLES_INSTALL_PATH}/kernel/kernels/cuda)
 delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_HEADERS}" ${CYCLES_INSTALL_PATH}/kernel)
+delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_BVH_HEADERS}" ${CYCLES_INSTALL_PATH}/kernel/bvh)
 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)
similarity index 94%
rename from intern/cycles/kernel/geom/geom_bvh.h
rename to intern/cycles/kernel/bvh/bvh.h
index f8d563f..b180259 100644 (file)
@@ -35,6 +35,13 @@ CCL_NAMESPACE_BEGIN
 #  define ccl_device_intersect ccl_device_inline
 #endif
 
+/* bottom-most stack entry, indicating the end of traversal */
+#define ENTRYPOINT_SENTINEL 0x76543210
+
+/* 64 object BVH + 64 mesh BVH + 64 object node splitting */
+#define BVH_STACK_SIZE 192
+#define BVH_QSTACK_SIZE 384
+
 /* BVH intersection function variations */
 
 #define BVH_INSTANCING                 1
@@ -72,39 +79,39 @@ CCL_NAMESPACE_BEGIN
 
 /* Common QBVH functions. */
 #ifdef __QBVH__
-#  include "geom_qbvh.h"
+#  include "qbvh_nodes.h"
 #endif
 
 /* Regular BVH traversal */
 
-#include "geom_bvh_nodes.h"
+#include "bvh_nodes.h"
 
 #define BVH_FUNCTION_NAME bvh_intersect
 #define BVH_FUNCTION_FEATURES 0
-#include "geom_bvh_traversal.h"
+#include "bvh_traversal.h"
 
 #if defined(__INSTANCING__)
 #  define BVH_FUNCTION_NAME bvh_intersect_instancing
 #  define BVH_FUNCTION_FEATURES BVH_INSTANCING
-#  include "geom_bvh_traversal.h"
+#  include "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 "geom_bvh_traversal.h"
+#  include "bvh_traversal.h"
 #endif
 
 #if defined(__OBJECT_MOTION__)
 #  define BVH_FUNCTION_NAME bvh_intersect_motion
 #  define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_MOTION
-#  include "geom_bvh_traversal.h"
+#  include "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 "geom_bvh_traversal.h"
+#  include "bvh_traversal.h"
 #endif
 
 /* Subsurface scattering BVH traversal */
@@ -112,13 +119,13 @@ CCL_NAMESPACE_BEGIN
 #if defined(__SUBSURFACE__)
 #  define BVH_FUNCTION_NAME bvh_intersect_subsurface
 #  define BVH_FUNCTION_FEATURES BVH_HAIR
-#  include "geom_bvh_subsurface.h"
+#  include "bvh_subsurface.h"
 #endif
 
 #if defined(__SUBSURFACE__) && defined(__OBJECT_MOTION__)
 #  define BVH_FUNCTION_NAME bvh_intersect_subsurface_motion
 #  define BVH_FUNCTION_FEATURES BVH_MOTION|BVH_HAIR
-#  include "geom_bvh_subsurface.h"
+#  include "bvh_subsurface.h"
 #endif
 
 /* Volume BVH traversal */
@@ -126,19 +133,19 @@ CCL_NAMESPACE_BEGIN
 #if defined(__VOLUME__)
 #  define BVH_FUNCTION_NAME bvh_intersect_volume
 #  define BVH_FUNCTION_FEATURES BVH_HAIR
-#  include "geom_bvh_volume.h"
+#  include "bvh_volume.h"
 #endif
 
 #if defined(__VOLUME__) && defined(__INSTANCING__)
 #  define BVH_FUNCTION_NAME bvh_intersect_volume_instancing
 #  define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR
-#  include "geom_bvh_volume.h"
+#  include "bvh_volume.h"
 #endif
 
 #if defined(__VOLUME__) && defined(__OBJECT_MOTION__)
 #  define BVH_FUNCTION_NAME bvh_intersect_volume_motion
 #  define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_MOTION|BVH_HAIR
-#  include "geom_bvh_volume.h"
+#  include "bvh_volume.h"
 #endif
 
 /* Record all intersections - Shadow BVH traversal */
@@ -146,31 +153,31 @@ CCL_NAMESPACE_BEGIN
 #if defined(__SHADOW_RECORD_ALL__)
 #  define BVH_FUNCTION_NAME bvh_intersect_shadow_all
 #  define BVH_FUNCTION_FEATURES 0
-#  include "geom_bvh_shadow.h"
+#  include "bvh_shadow.h"
 #endif
 
 #if defined(__SHADOW_RECORD_ALL__) && defined(__INSTANCING__)
 #  define BVH_FUNCTION_NAME bvh_intersect_shadow_all_instancing
 #  define BVH_FUNCTION_FEATURES BVH_INSTANCING
-#  include "geom_bvh_shadow.h"
+#  include "bvh_shadow.h"
 #endif
 
 #if defined(__SHADOW_RECORD_ALL__) && defined(__HAIR__)
 #  define BVH_FUNCTION_NAME bvh_intersect_shadow_all_hair
 #  define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR
-#  include "geom_bvh_shadow.h"
+#  include "bvh_shadow.h"
 #endif
 
 #if defined(__SHADOW_RECORD_ALL__) && defined(__OBJECT_MOTION__)
 #  define BVH_FUNCTION_NAME bvh_intersect_shadow_all_motion
 #  define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_MOTION
-#  include "geom_bvh_shadow.h"
+#  include "bvh_shadow.h"
 #endif
 
 #if defined(__SHADOW_RECORD_ALL__) && defined(__HAIR__) && defined(__OBJECT_MOTION__)
 #  define BVH_FUNCTION_NAME bvh_intersect_shadow_all_hair_motion
 #  define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR|BVH_MOTION
-#  include "geom_bvh_shadow.h"
+#  include "bvh_shadow.h"
 #endif
 
 /* Record all intersections - Volume BVH traversal  */
@@ -178,19 +185,19 @@ CCL_NAMESPACE_BEGIN
 #if defined(__VOLUME_RECORD_ALL__)
 #  define BVH_FUNCTION_NAME bvh_intersect_volume_all
 #  define BVH_FUNCTION_FEATURES BVH_HAIR
-#  include "geom_bvh_volume_all.h"
+#  include "bvh_volume_all.h"
 #endif
 
 #if defined(__VOLUME_RECORD_ALL__) && defined(__INSTANCING__)
 #  define BVH_FUNCTION_NAME bvh_intersect_volume_all_instancing
 #  define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR
-#  include "geom_bvh_volume_all.h"
+#  include "bvh_volume_all.h"
 #endif
 
 #if defined(__VOLUME_RECORD_ALL__) && defined(__OBJECT_MOTION__)
 #  define BVH_FUNCTION_NAME bvh_intersect_volume_all_motion
 #  define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_MOTION|BVH_HAIR
-#  include "geom_bvh_volume_all.h"
+#  include "bvh_volume_all.h"
 #endif
 
 #undef BVH_FEATURE
similarity index 99%
rename from intern/cycles/kernel/geom/geom_bvh_shadow.h
rename to intern/cycles/kernel/bvh/bvh_shadow.h
index a54c602..02147d2 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #ifdef __QBVH__
-#  include "geom_qbvh_shadow.h"
+#  include "qbvh_shadow.h"
 #endif
 
 #if BVH_FEATURE(BVH_HAIR)
similarity index 99%
rename from intern/cycles/kernel/geom/geom_bvh_subsurface.h
rename to intern/cycles/kernel/bvh/bvh_subsurface.h
index 88aaf01..7121c57 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #ifdef __QBVH__
-#  include "geom_qbvh_subsurface.h"
+#  include "qbvh_subsurface.h"
 #endif
 
 #if BVH_FEATURE(BVH_HAIR)
similarity index 99%
rename from intern/cycles/kernel/geom/geom_bvh_traversal.h
rename to intern/cycles/kernel/bvh/bvh_traversal.h
index f409dd5..36c3398 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #ifdef __QBVH__
-#  include "geom_qbvh_traversal.h"
+#  include "qbvh_traversal.h"
 #endif
 
 #if BVH_FEATURE(BVH_HAIR)
similarity index 99%
rename from intern/cycles/kernel/geom/geom_bvh_volume.h
rename to intern/cycles/kernel/bvh/bvh_volume.h
index 5e70ce9..8b44c66 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #ifdef __QBVH__
-#  include "geom_qbvh_volume.h"
+#  include "qbvh_volume.h"
 #endif
 
 #if BVH_FEATURE(BVH_HAIR)
similarity index 99%
rename from intern/cycles/kernel/geom/geom_bvh_volume_all.h
rename to intern/cycles/kernel/bvh/bvh_volume_all.h
index ab5ac85..445243c 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #ifdef __QBVH__
-#  include "geom_qbvh_volume_all.h"
+#  include "qbvh_volume_all.h"
 #endif
 
 #if BVH_FEATURE(BVH_HAIR)
index 33e91d1..d2c7edb 100644 (file)
  * limitations under the License.
  */
 
-/* bottom-most stack entry, indicating the end of traversal */
-#define ENTRYPOINT_SENTINEL 0x76543210
-
-/* 64 object BVH + 64 mesh BVH + 64 object node splitting */
-#define BVH_STACK_SIZE 192
-#define BVH_QSTACK_SIZE 384
-#define TRI_NODE_SIZE 3
-
 #include "geom_attribute.h"
 #include "geom_object.h"
 #include "geom_triangle.h"
@@ -32,5 +24,4 @@
 #include "geom_curve.h"
 #include "geom_volume.h"
 #include "geom_primitive.h"
-#include "geom_bvh.h"
 
index 3c3503e..d5b3103 100644 (file)
@@ -25,6 +25,7 @@
 #include "kernel_camera.h"
 
 #include "geom/geom.h"
+#include "bvh/bvh.h"
 
 #include "kernel_accumulate.h"
 #include "kernel_shader.h"
index aad06ed..37907cd 100644 (file)
@@ -35,6 +35,7 @@
 #  include "../../kernel_montecarlo.h"
 #  include "../../kernel_projection.h"
 #  include "../../geom/geom.h"
+#  include "../../bvh/bvh.h"
 
 #  include "../../kernel_accumulate.h"
 #  include "../../kernel_camera.h"
index acc6887..2bb2be5 100644 (file)
@@ -47,6 +47,7 @@
 #include "kernel_camera.h"
 #include "kernels/cpu/kernel_cpu_image.h"
 #include "geom/geom.h"
+#include "bvh/bvh.h"
 
 #include "kernel_projection.h"
 #include "kernel_accumulate.h"
index e1c7e2c..88d6dab 100644 (file)
@@ -31,6 +31,7 @@
 #include "kernel_camera.h"
 
 #include "geom/geom.h"
+#include "bvh/bvh.h"
 
 #include "kernel_accumulate.h"
 #include "kernel_shader.h"