|
|
Am 02.07.2014 18:44, schrieb Le_Forgeron:
> Rendering benchmark gives the attached pictures (the icpc seems ok,
> within usual time, but gcc is bogus and too fast, far too fast)
I finally found out what's going on here.
The implementation of adaptive area lights uses an N*M cache for
"lightlet" data it has already computed. Previously, yet-uncomputed data
was flagged by setting the respective colour's red channel to -1. I had
changed this to use a NaN ("Not-a-Number") value instead, to avoid
problems when a user deliberately sets a light source's colour to
negative red.
Now of course this NaN value has to be tested for; according to IEEE
standard, a NaN value has the property that it is non-equal to anything,
even itself. So I wrote the test: "if (red != red)...".
Well, it turns out that the g++ compiler optimizes this comparison away
when in "-ffast_math" mode.
Post a reply to this message
|
|