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
path: root/intern
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2014-11-24 15:18:02 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2014-11-24 16:50:46 +0300
commit9311a5be04b66411442e4e2b99b3211a06d7e326 (patch)
tree97c6dc06726d5045929c60a32576dbefeae84589 /intern
parentc1149198b5983f13bfd9bc21263b0e278e07da94 (diff)
Cycles: Speedup BVH build for certain compilers
The issue was noticed with gcc-4.7 (used by the release build environment) which didn't generate optimal enough code for BVH references swap. Seems it looked up for the assign operator for each of the reference structure members even though nothing special was required for assignment. Forcing compiler to use simple memory copy gives speedup of like 2-3 times. The issue doesn't happen with OSX's clang and new gcc-4.9, but since we're gonna to stick to gcc-4.7 for official releases for quite some time still it's nice to have performance issues resolved for all the compilers. Didn't put the code into #ifdef so if in the future some issues appears with alignment or assignment which need to happen as an operator we notice this earlier.
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/bvh/bvh_params.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/intern/cycles/bvh/bvh_params.h b/intern/cycles/bvh/bvh_params.h
index e073b69472e..43c2d9b2683 100644
--- a/intern/cycles/bvh/bvh_params.h
+++ b/intern/cycles/bvh/bvh_params.h
@@ -115,6 +115,11 @@ public:
__forceinline int prim_object() const { return __float_as_int(rbounds.max.w); }
__forceinline int prim_type() const { return type; }
+ BVHReference& operator=(const BVHReference &arg) {
+ memcpy(this, &arg, sizeof(BVHReference));
+ return *this;
+ }
+
protected:
BoundBox rbounds;
uint type;