Yellow-Dog-Man / FreeImage

Customized fork of the FreeImage library
Other
11 stars 6 forks source link

Disable NEON acceleration on ARM since it's broken apparently #5

Open BlueCyro opened 11 months ago

BlueCyro commented 11 months ago

After doing some research, it appears that ARM NEON acceleration for PNGs is just broken(?) apparently. In any case, trying to build this repository on ARM systems with NEON acceleration results in a missing symbol when trying to run the headless. (Tested on Ampere A1 ARM)

Simply disabling the neon acceleration fixes this and appears inconsequential to the usage of the library. Especially since everything gets converted to WebP and the NEON acceleration is particular to the PNG code.

BlueCyro commented 11 months ago

As an addendum, this was used extensively on very active (15-20+ player) sessions and there have been no reports of noticeable performance degradation.

Frooxius commented 11 months ago

Are you sure it's broken? Could it just be a compilation/tooling issue.

I'd rather not disable this, as that can have significant performance impacts. It's not something you'd notice with number of players, but rather specifically encoding/decoding PNG's, having it take longer than usual, so I don't think you'd catch it through reports like that.

It might be better idea to instead update libPNG to a newer version first if you're experiencing issues and see if that helps.

BlueCyro commented 11 months ago

https://sourceforge.net/p/freeimage/bugs/325/

There's a comment here that outlines including the arm folder from upstream, but doing so appears to just... not do anything. The symbols for neon are still missing even with including that folder in the LibPNG folder. I've also tried to replace the LibPNG sources in FreeImage with brand new ones but I don't think the version of LibPNG that you can download yourself is made for FreeImage (it makes FreeImage fail to compile)

Frooxius commented 10 months ago

None of the libraries FreeImage uses are made for FreeImage. If there are API changes or the new versions include new sources, you'll need to adjust FreeImage make files to include those new files and/or made adjustments to the FreeImage code itself to accommodate for the changes.

I had to do that when updating libWebP for example, just dropping the files in wouldn't work out of the box.