BinomialLLC / basis_universal

Basis Universal GPU Texture Codec
Apache License 2.0
2.73k stars 267 forks source link

The encoded basis file is different on macOS and Ubuntu #267

Closed ismacaulay closed 2 years ago

ismacaulay commented 3 years ago

Hi,

I am experimenting with basis universal, and came across an unexpected behaviour where the generated .basis file is not the same between macOS 11.6 and Ubuntu 20.04. The resulting basis file on Ubuntu is 9 bytes larger. I am curious if this is expected.

Some notes:

Further investigation makes it appear that the transcoded image produced by both basis files are also not the same. Again, this was a bit unexpected to me as I would have assumed that the basisu tool would produce the same output regardless of platform when given the same input png.

If this is expected behaviour then great, otherwise I am happy to provide any addition information needed to help debug

Thanks

richgel999 commented 2 years ago

Yes, this is expected. You would have to use the same compilers on each platform. Unfortunately, our customers use a lot of floating point calculations, and the various compilers output slightly different optimized code.

ismacaulay commented 2 years ago

That makes sense. I don't know enough about the internals of basis universal so I was not sure. Thanks for clarifying that for me!