Closed GraphicsMe closed 10 years ago
Wait, is zero not a power of two? When did they change that? ;)
Does this affect any actual renderings, or is this mostly for purity?
I just took a look at the places where we use IsPowerOf2; this fix shouldn't affect performance in any way. It's always used in places where 0 would be a nonsense value.
Of course this will not cause problem in PBRT, except that user accidentally provide nonsense parameter. Anyway, as a fan of PBRT, I often refer code from it and use it in other context. Just in case other people do that like me, IsPowerOf2 being correct itself is also important:)
In file /src/core/pbrt.h, fuction IsPowerOf2, 0 is considered a power of 2. The remedy is straight forward. Please check it out.