[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [42298] trunk/blender/intern/cycles/kernel /kernel_bvh.h: Another possible fix for #29301: issue with BVH intersection , reorder code a

Brecht Van Lommel brechtvanlommel at pandora.be
Wed Nov 30 17:29:26 CET 2011


Revision: 42298
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42298
Author:   blendix
Date:     2011-11-30 16:29:26 +0000 (Wed, 30 Nov 2011)
Log Message:
-----------
Another possible fix for #29301: issue with BVH intersection, reorder code a
bit so that it's more symmetric and resulting float ops are compiled the same
way. Otherwise extended float precision being used in one place and not the
other can make comparisons fail.

Modified Paths:
--------------
    trunk/blender/intern/cycles/kernel/kernel_bvh.h

Modified: trunk/blender/intern/cycles/kernel/kernel_bvh.h
===================================================================
--- trunk/blender/intern/cycles/kernel/kernel_bvh.h	2011-11-30 16:26:30 UTC (rev 42297)
+++ trunk/blender/intern/cycles/kernel/kernel_bvh.h	2011-11-30 16:29:26 UTC (rev 42298)
@@ -94,11 +94,11 @@
 	float c0hiy = n0xy.w * idir.y - ood.y;
 	float c0loz = nz.x * idir.z - ood.z;
 	float c0hiz = nz.y * idir.z - ood.z;
+	float c0min = max4(min(c0lox, c0hix), min(c0loy, c0hiy), min(c0loz, c0hiz), 0.0f);
+	float c0max = min4(max(c0lox, c0hix), max(c0loy, c0hiy), max(c0loz, c0hiz), t);
+
 	float c1loz = nz.z * idir.z - ood.z;
 	float c1hiz = nz.w * idir.z - ood.z;
-
-	float c0min = max4(min(c0lox, c0hix), min(c0loy, c0hiy), min(c0loz, c0hiz), 0.0f);
-	float c0max = min4(max(c0lox, c0hix), max(c0loy, c0hiy), max(c0loz, c0hiz), t);
 	float c1lox = n1xy.x * idir.x - ood.x;
 	float c1hix = n1xy.y * idir.x - ood.x;
 	float c1loy = n1xy.z * idir.y - ood.y;




More information about the Bf-blender-cvs mailing list