Using the Intel Vulkan driver, we've found some cases where SpvOpSelect is returning -0.0 (negative zeros) instead of normal 0.0 depending on the arguments.

I'm wondering if "SpvOpSelect x, a, b" for floats is being implemented with something like "a*x + b*(1-x)" ? That might explain where the negative zeros are coming from.

Our work-around is to implement selection with bitwise operations: (a & x) | (b & ~x)

It seems to me that SpvOpSelect shouldn't interpret the bits and just return an exact copy of the argument.

-Brian
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to