Files
test/intern
Lukas Stockner 1a40efbded Fix #130389: Cycles: Numerical issues in GGX_D with associative math flag
Turns out that with `-fassociative-math`, GCC turns
`(1.0f - cos_NH2) + alpha2 * cos_NH2` into
`cos_NH2 * (alpha2 - 1.0f) + 1.0f`.

Not sure why since the operation count is the same, but if alpha2 is very
small, `alpha2 - 1.0f` will be exactly -1.0f, which then causes issues.

Luckily, having one_minus_cos_NH2 as its own variable appears to be enough to
make GCC keep the original formulation.
Just to be safe, I've also used one_minus_cos_NH2 in the other branch to
hopefully reduce the chance of it being folded in again. Also turns a
division into a reciprocal, which is in theory slightly faster.

Pull Request: https://projects.blender.org/blender/blender/pulls/130469
2024-11-18 19:12:22 +01:00
..
2024-09-20 13:14:57 +10:00
2024-11-09 01:33:16 +01:00
2024-01-03 13:38:14 +01:00
2024-09-20 19:46:56 +10:00
2024-02-05 17:08:17 +01:00
2024-07-30 12:23:09 +10:00