fix fast-math kd-tree building problem on windows
parent
7a319e6cc4
commit
f531af3e2d
|
@ -430,6 +430,10 @@ private:
|
||||||
size_t m_bufferSize;
|
size_t m_bufferSize;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if defined(WIN32)
|
||||||
|
#pragma float_control(precise, on)
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief SAH KD-tree acceleration data structure for fast ray-object
|
* \brief SAH KD-tree acceleration data structure for fast ray-object
|
||||||
* intersection computations.
|
* intersection computations.
|
||||||
|
@ -2694,7 +2698,7 @@ protected:
|
||||||
/* Floating-point arithmetic.. - use both absolute and relative
|
/* Floating-point arithmetic.. - use both absolute and relative
|
||||||
epsilons when looking for intersections in the subinterval */
|
epsilons when looking for intersections in the subinterval */
|
||||||
#if defined(SINGLE_PRECISION)
|
#if defined(SINGLE_PRECISION)
|
||||||
const Float eps = 1e-3;
|
const Float eps = 1e-3f;
|
||||||
#else
|
#else
|
||||||
const Float eps = 1e-5;
|
const Float eps = 1e-5;
|
||||||
#endif
|
#endif
|
||||||
|
@ -2825,7 +2829,7 @@ protected:
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(SINGLE_PRECISION)
|
#if defined(SINGLE_PRECISION)
|
||||||
const Float eps = 1e-3;
|
const Float eps = 1e-3f;
|
||||||
#else
|
#else
|
||||||
const Float eps = 1e-5;
|
const Float eps = 1e-5;
|
||||||
#endif
|
#endif
|
||||||
|
@ -3082,9 +3086,9 @@ template <typename Derived> void GenericKDTree<Derived>::findCosts(
|
||||||
Point p2 = bsphere.center + squareToSphere(sample2) * bsphere.radius;
|
Point p2 = bsphere.center + squareToSphere(sample2) * bsphere.radius;
|
||||||
Ray ray(p1, normalize(p2-p1));
|
Ray ray(p1, normalize(p2-p1));
|
||||||
Float mint, maxt, t;
|
Float mint, maxt, t;
|
||||||
if (ray.mint > mint) mint = ray.mint;
|
|
||||||
if (ray.maxt < maxt) maxt = ray.maxt;
|
|
||||||
if (m_aabb.rayIntersect(ray, mint, maxt)) {
|
if (m_aabb.rayIntersect(ray, mint, maxt)) {
|
||||||
|
if (ray.mint > mint) mint = ray.mint;
|
||||||
|
if (ray.maxt < maxt) maxt = ray.maxt;
|
||||||
if (EXPECT_TAKEN(maxt > mint)) {
|
if (EXPECT_TAKEN(maxt > mint)) {
|
||||||
boost::tuple<bool, uint32_t, uint32_t, uint64_t> statistics =
|
boost::tuple<bool, uint32_t, uint32_t, uint64_t> statistics =
|
||||||
rayIntersectHavranCollectStatistics(ray, mint, maxt, t, temp);
|
rayIntersectHavranCollectStatistics(ray, mint, maxt, t, temp);
|
||||||
|
@ -3159,6 +3163,11 @@ template <typename Derived> const Class *GenericKDTree<Derived>::getClass() cons
|
||||||
return m_theClass;
|
return m_theClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(WIN32)
|
||||||
|
#pragma float_control(precise, off)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
MTS_NAMESPACE_END
|
MTS_NAMESPACE_END
|
||||||
|
|
||||||
#endif /* __KDTREE_GENERIC_H */
|
#endif /* __KDTREE_GENERIC_H */
|
||||||
|
|
Loading…
Reference in New Issue