[Bf-blender-cvs] [55de0b9] cycles_bvh: Cycles: Enable unaligned traversal for SSS and volume functions
Sergey Sharybin
noreply at git.blender.org
Wed Jun 15 14:04:35 CEST 2016
Commit: 55de0b9aa40f9a6097c170e2febe7262acc765b2
Author: Sergey Sharybin
Date: Wed Jun 15 14:02:26 2016 +0200
Branches: cycles_bvh
https://developer.blender.org/rB55de0b9aa40f9a6097c170e2febe7262acc765b2
Cycles: Enable unaligned traversal for SSS and volume functions
Currently this traversal functions will always think there are unaligned
nodes in the scene and check visibility flags. This might not be fully
ideal, but on another hand adding more traversal functions might:
(a) Bump stack memory size on Maxwell GPUs (see the discussion on the
Cycles mailing list)
(b) Not give real speed advantages.
So for now let's use simpler way and gather some benchmarks.
===================================================================
M intern/cycles/kernel/geom/geom_bvh.h
M intern/cycles/kernel/geom/geom_qbvh_subsurface.h
===================================================================
diff --git a/intern/cycles/kernel/geom/geom_bvh.h b/intern/cycles/kernel/geom/geom_bvh.h
index c7978fa..3960de8 100644
--- a/intern/cycles/kernel/geom/geom_bvh.h
+++ b/intern/cycles/kernel/geom/geom_bvh.h
@@ -110,13 +110,13 @@ CCL_NAMESPACE_BEGIN
#if defined(__SUBSURFACE__)
# define BVH_FUNCTION_NAME bvh_intersect_subsurface
-# define BVH_FUNCTION_FEATURES 0
+# define BVH_FUNCTION_FEATURES BVH_HAIR
# 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_MOTION
+# define BVH_FUNCTION_FEATURES BVH_MOTION|BVH_HAIR
# include "geom_bvh_subsurface.h"
#endif
@@ -124,19 +124,19 @@ CCL_NAMESPACE_BEGIN
#if defined(__VOLUME__)
# define BVH_FUNCTION_NAME bvh_intersect_volume
-# define BVH_FUNCTION_FEATURES 0
+# define BVH_FUNCTION_FEATURES BVH_HAIR
# include "geom_bvh_volume.h"
#endif
#if defined(__VOLUME__) && defined(__INSTANCING__)
# define BVH_FUNCTION_NAME bvh_intersect_volume_instancing
-# define BVH_FUNCTION_FEATURES BVH_INSTANCING
+# define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR
# include "geom_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
+# define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_MOTION|BVH_HAIR
# include "geom_bvh_volume.h"
#endif
@@ -176,19 +176,19 @@ CCL_NAMESPACE_BEGIN
#if defined(__VOLUME_RECORD_ALL__)
# define BVH_FUNCTION_NAME bvh_intersect_volume_all
-# define BVH_FUNCTION_FEATURES 0
+# define BVH_FUNCTION_FEATURES BVH_HAIR
# include "geom_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
+# define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR
# include "geom_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
+# define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_MOTION|BVH_HAIR
# include "geom_bvh_volume_all.h"
#endif
diff --git a/intern/cycles/kernel/geom/geom_qbvh_subsurface.h b/intern/cycles/kernel/geom/geom_qbvh_subsurface.h
index 235b677..b9c94c9 100644
--- a/intern/cycles/kernel/geom/geom_qbvh_subsurface.h
+++ b/intern/cycles/kernel/geom/geom_qbvh_subsurface.h
@@ -138,6 +138,7 @@ ccl_device void BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg,
&dist);
if(traverseChild != 0) {
+ float4 inodes = kernel_tex_fetch(__bvh_nodes, nodeAddr+0);
float4 cnodes;
#if BVH_FEATURE(BVH_HAIR)
if(__float_as_uint(inodes.x) & PATH_RAY_NODE_UNALIGNED) {
More information about the Bf-blender-cvs
mailing list