Fix T41601: Correlated multi-jitter with high samples "hangs"

Issue was caused by the precision issues which made sdivm by 1 under
it's actual value. We can try to do some eps magic, but from the tests
on laptop and desktop doing integer division is not slower than using
floats here.
This commit is contained in:
Sergey Sharybin
2014-08-28 15:15:59 +06:00
parent 6891f1c9e0
commit d84c15696b

View File

@@ -182,7 +182,8 @@ ccl_device void cmj_sample_2D(int s, int N, int p, float *fx, float *fy)
smodm = cmj_fast_mod_pow2(s, m);
}
else {
sdivm = float_to_int(s * invm);
/* Doing s*inmv gives precision issues here. */
sdivm = s / m;
smodm = s - sdivm*m;
}