[Bf-blender-cvs] [deb06c4] master: Cycles: Correction for node tail copy on packing BVH

Sergey Sharybin noreply at git.blender.org
Wed Dec 24 22:56:30 CET 2014


Commit: deb06c457d59a3acaa4d81bdbb460d8c74e05c37
Author: Sergey Sharybin
Date:   Thu Dec 25 02:49:27 2014 +0500
Branches: master
https://developer.blender.org/rBdeb06c457d59a3acaa4d81bdbb460d8c74e05c37

Cycles: Correction for node tail copy on packing BVH

This is harmless for now because tail of the node is zero in there, but better
to fix it early so in the case of extending BVH nodes this code doesn't give
issues.

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

M	intern/cycles/bvh/bvh.cpp

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

diff --git a/intern/cycles/bvh/bvh.cpp b/intern/cycles/bvh/bvh.cpp
index e7141c9..eafb611 100644
--- a/intern/cycles/bvh/bvh.cpp
+++ b/intern/cycles/bvh/bvh.cpp
@@ -479,11 +479,12 @@ void BVH::pack_instances(size_t nodes_size)
 
 				pack_nodes[pack_nodes_offset + nsize_bbox] = data;
 
-				if(use_qbvh) {
-					memcpy(&pack_nodes[pack_nodes_offset + nsize_bbox+1],
-					       &bvh_nodes[i + nsize_bbox+1],
-					       sizeof(int4) * (nsize - (nsize_bbox+1)));
-				}
+				/* Usually this is gonna to copy nothing, but we'd better to
+				 * beprepared for possible node size extension.
+				 */
+				memcpy(&pack_nodes[pack_nodes_offset + nsize_bbox+1],
+				       &bvh_nodes[i + nsize_bbox+1],
+				       sizeof(int4) * (nsize - (nsize_bbox+1)));
 
 				pack_nodes_offset += nsize;
 			}




More information about the Bf-blender-cvs mailing list