[Bf-blender-cvs] [a6db95c] master: Cycles: Re-group ifdef so we check for particular feature only once

Sergey Sharybin noreply at git.blender.org
Tue Sep 20 16:58:42 CEST 2016


Commit: a6db95cd4215dfe20038617ddb81f9ec300ec06b
Author: Sergey Sharybin
Date:   Tue Sep 20 13:21:47 2016 +0200
Branches: master
https://developer.blender.org/rBa6db95cd4215dfe20038617ddb81f9ec300ec06b

Cycles: Re-group ifdef so we check for particular feature only once

===================================================================

M	intern/cycles/kernel/bvh/bvh.h

===================================================================

diff --git a/intern/cycles/kernel/bvh/bvh.h b/intern/cycles/kernel/bvh/bvh.h
index 512b049..85bfd93 100644
--- a/intern/cycles/kernel/bvh/bvh.h
+++ b/intern/cycles/kernel/bvh/bvh.h
@@ -73,13 +73,13 @@ CCL_NAMESPACE_BEGIN
 #  define BVH_FUNCTION_NAME bvh_intersect_subsurface
 #  define BVH_FUNCTION_FEATURES BVH_HAIR
 #  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 "bvh_subsurface.h"
-#endif
+#  if defined(__OBJECT_MOTION__)
+#    define BVH_FUNCTION_NAME bvh_intersect_subsurface_motion
+#    define BVH_FUNCTION_FEATURES BVH_MOTION|BVH_HAIR
+#    include "bvh_subsurface.h"
+#  endif
+#endif  /* __SUBSURFACE__ */
 
 /* Volume BVH traversal */
 
@@ -87,19 +87,19 @@ CCL_NAMESPACE_BEGIN
 #  define BVH_FUNCTION_NAME bvh_intersect_volume
 #  define BVH_FUNCTION_FEATURES BVH_HAIR
 #  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 "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 "bvh_volume.h"
-#endif
+#  if defined(__INSTANCING__)
+#    define BVH_FUNCTION_NAME bvh_intersect_volume_instancing
+#    define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR
+#    include "bvh_volume.h"
+#  endif
+
+#  if defined(__OBJECT_MOTION__)
+#    define BVH_FUNCTION_NAME bvh_intersect_volume_motion
+#    define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_MOTION|BVH_HAIR
+#    include "bvh_volume.h"
+#  endif
+#endif  /* __VOLUME__ */
 
 /* Record all intersections - Shadow BVH traversal */
 
@@ -107,31 +107,31 @@ CCL_NAMESPACE_BEGIN
 #  define BVH_FUNCTION_NAME bvh_intersect_shadow_all
 #  define BVH_FUNCTION_FEATURES 0
 #  include "bvh_shadow_all.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 "bvh_shadow_all.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 "bvh_shadow_all.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 "bvh_shadow_all.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 "bvh_shadow_all.h"
-#endif
+#  if defined(__INSTANCING__)
+#    define BVH_FUNCTION_NAME bvh_intersect_shadow_all_instancing
+#    define BVH_FUNCTION_FEATURES BVH_INSTANCING
+#    include "bvh_shadow_all.h"
+#  endif
+
+#  if defined(__HAIR__)
+#    define BVH_FUNCTION_NAME bvh_intersect_shadow_all_hair
+#    define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR
+#    include "bvh_shadow_all.h"
+#  endif
+
+#  if defined(__OBJECT_MOTION__)
+#    define BVH_FUNCTION_NAME bvh_intersect_shadow_all_motion
+#    define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_MOTION
+#    include "bvh_shadow_all.h"
+#  endif
+
+#  if 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 "bvh_shadow_all.h"
+#  endif
+#endif  /* __SHADOW_RECORD_ALL__ */
 
 /* Record all intersections - Volume BVH traversal  */
 
@@ -139,19 +139,19 @@ CCL_NAMESPACE_BEGIN
 #  define BVH_FUNCTION_NAME bvh_intersect_volume_all
 #  define BVH_FUNCTION_FEATURES BVH_HAIR
 #  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 "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 "bvh_volume_all.h"
-#endif
+#  if defined(__INSTANCING__)
+#    define BVH_FUNCTION_NAME bvh_intersect_volume_all_instancing
+#    define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR
+#    include "bvh_volume_all.h"
+#  endif
+
+#  if defined(__OBJECT_MOTION__)
+#    define BVH_FUNCTION_NAME bvh_intersect_volume_all_motion
+#    define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_MOTION|BVH_HAIR
+#    include "bvh_volume_all.h"
+#  endif
+#endif  /* __VOLUME_RECORD_ALL__ */
 
 #undef BVH_FEATURE
 #undef BVH_NAME_JOIN




More information about the Bf-blender-cvs mailing list