Cycles: Fix bug in CMJ pattern when number of samples is 1

It was wrongly considering 1 is a power of 2. While it is a correct thing
(1 == 2^0) it's not what the math in some later formulas expects.
This commit is contained in:
Sergey Sharybin 2016-02-24 14:23:45 +01:00
parent 48d399a321
commit b6d9cbe654
1 changed files with 1 additions and 1 deletions

View File

@ -26,7 +26,7 @@ CCL_NAMESPACE_BEGIN
ccl_device_inline bool cmj_is_pow2(int i)
{
return (i & (i - 1)) == 0;
return (i > 1) && ((i & (i - 1)) == 0);
}
ccl_device_inline int cmj_fast_mod_pow2(int a, int b)