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.
This commit is contained in:
Brecht Van Lommel 2011-11-30 16:29:26 +00:00
parent af5adbad3f
commit b6021462a8

@ -94,11 +94,11 @@ __device_inline void bvh_node_intersect(KernelGlobals *kg,
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 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 c1loz = nz.z * idir.z - ood.z;
float c1hiz = nz.w * idir.z - ood.z;
float c1lox = n1xy.x * idir.x - ood.x;
float c1hix = n1xy.y * idir.x - ood.x;
float c1loy = n1xy.z * idir.y - ood.y;