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 3c2f7747f345fdfc0f1ea729f6552151c01f0d51..3f0917bb9920faac84c7c360eddecac588e7b5fe 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 f8d563f0afa9c3166700cf632aacdaf2d69430dc..b1802596c5ad8e6cfa4f6029f9ff70d72f50432d 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 a54c60241526e213bcb62f0caf88ccfef3230922..02147d20feeff102212fc3e609ccb3644baf7798 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 88aaf01d68281f08c6e63def1e51689f9ffaaeb4..7121c5791dfae85ea5d9b1d14cbaef40a21dbf25 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 f409dd5f4033dcccbfc6ca8de90b3ef68dc43c14..36c3398335cf5582e0e43d2f0ce168925f8fc547 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 5e70ce99f516c8735b34ac7b86582ee5723b0ae0..8b44c66f7aaf38201e2423dec6e7a162dfc3145a 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 ab5ac8505a30cd31f363c6aba09a37def9c019ef..445243c4e5ce5c65bda7e9368de2e346c0c06626 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 33e91d1ee44d787972fc207d3eb31b8a990ad6f4..d2c7edb11ea249dcf86fda3e5f840433362fd3d0 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 3c3503eab8b4d500a750d43862a3fc959b158986..d5b310377237c01b05ef18c6a4af0a1ff7b1662c 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 aad06ed5c76fd44e135d6b77142b8cb14bb66c4b..37907cd8fdc1efcba2ac5fb95f128286df78b1e6 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 acc6887cb1791b637f2c1cb03f9495d6b64c3171..2bb2be5e6b3852447516becbb6159c2e114092e9 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 e1c7e2cea9953d354f7d39a0fba6da6726333d5c..88d6dab04d08cb8aca925beb392e5a2b71c490f2 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"