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:
parent
48d399a321
commit
b6d9cbe654
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue