Closed
Description
I have this code:
// simd is enable
bx::Vec3 nv = bx::normalize(bx::Vec3(0.f, 1.f, 0.f));
On window platform, it will return: nv = (0.f, 1.f, 0.f), as we expected.
On macOS/iOS(ARM architecture), it will return: nv = (0.f, 1.00000572f, 0.f), the y coordinate is slightly larger than 1.
I dig into the code, I found that, simd_sqrt with value 1, will return a value less than 1.
It will bring some bad result, like:
const bx::Vec3 dir = texelUvToDir(side, uu, vv);
float srcU, srcV;
bx::toLatLong(&srcU, &srcV, dir);
here, dir should return value (0.f, 1.f, 0.f), but we get (0.f, 1.00000572f, 0.f), it cause bx::toLatLong return NaN in srcV
this code is from:
https://github.com/bkaradzic/bimg/blob/master/src/image_cubemap_filter.cpp#L242
Metadata
Metadata
Assignees
Labels
No labels