Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-05-27 11:55:48 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-05-27 11:55:48 +0300
commit7dae62cde0e4159c6a952655da3ae87b44f5c64e (patch)
tree484802c3b2f487087276573823f1a30096ef1086 /intern/cycles/kernel/geom/geom_bvh.h
parentc3eb7c4e9d05e96ec9e858b398640b0c8c9692ea (diff)
Cycles: Simplify code around debug stats in BVH traversing
Diffstat (limited to 'intern/cycles/kernel/geom/geom_bvh.h')
-rw-r--r--intern/cycles/kernel/geom/geom_bvh.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/intern/cycles/kernel/geom/geom_bvh.h b/intern/cycles/kernel/geom/geom_bvh.h
index 9eadc97386c..d0eedd3396a 100644
--- a/intern/cycles/kernel/geom/geom_bvh.h
+++ b/intern/cycles/kernel/geom/geom_bvh.h
@@ -48,6 +48,28 @@ CCL_NAMESPACE_BEGIN
#define BVH_FEATURE(f) (((BVH_FUNCTION_FEATURES) & (f)) != 0)
+/* Debugging heleprs */
+#ifdef __KERNEL_DEBUG__
+# define BVH_DEBUG_INIT() \
+ do { \
+ isect->num_traversal_steps = 0; \
+ isect->num_traversed_instances = 0; \
+ } while(0)
+# define BVH_DEBUG_NEXT_STEP() \
+ do { \
+ ++isect->num_traversal_steps; \
+ } while(0)
+# define BVH_DEBUG_NEXT_INSTANCE() \
+ do { \
+ ++isect->num_traversed_instances; \
+ } while(0)
+#else /* __KERNEL_DEBUG__ */
+# define BVH_DEBUG_INIT()
+# define BVH_DEBUG_NEXT_STEP()
+# define BVH_DEBUG_NEXT_INSTANCE()
+#endif /* __KERNEL_DEBUG__ */
+
+
/* Common QBVH functions. */
#ifdef __QBVH__
# include "geom_qbvh.h"