Page 1 of 1

OGRE port to LoongArch64 with LSX SIMD optimizations (tested on Loongson 3B6000M)

Posted: Wed Dec 17, 2025 12:20 pm
by ycsqwan

Hi everyone,I'm here to share a personal project: a fork of OGRE with added support for the LoongArch64 architecture, including automatic LSX SIMD optimizations for better performance on Loongson CPUs.Repository: https://github.com/ycsqwan/ogre-loongarch64-lsx (branch: loongarch64-lsx)Changes:CMake now detects LoongArch64 and enables -march=loongarch64 and -mlsx flags.

Focused on the OpenGL/GL3+/GLES2 render systems (Vulkan disabled due to current driver maturity on LoongArch).
Successfully built and tested on Loongnix GNU/Linux with a Loongson-3B6000M.The SampleBrowser runs at around 60 FPS in scenes (screenshot in README).

This is just a rough attempt using crude techniques to bring OGRE to an emerging architecture like LoongArch. Any feedback, suggestions for improvement, or testing on other LoongArch hardware would be very helpful!Thanks,
ycsqwan


Re: OGRE port to LoongArch64 with LSX SIMD optimizations (tested on Loongson 3B6000M)

Posted: Wed Dec 17, 2025 3:32 pm
by paroj

if your goal was to get this into upstream ogre, it would be better to commit the individual changes on top of upstream master instead of having one "Initial commit: .." with everything.


Re: OGRE port to LoongArch64 with LSX SIMD optimizations (tested on Loongson 3B6000M)

Posted: Wed Dec 17, 2025 3:39 pm
by paroj

as far as I can see the changes boil down to:

Code: Select all

cmake -DCMAKE_CXX_FLAGS="-march=loongarch64 -mlsx" ...

Re: OGRE port to LoongArch64 with LSX SIMD optimizations (tested on Loongson 3B6000M)

Posted: Wed Dec 17, 2025 3:54 pm
by ycsqwan
paroj wrote: Wed Dec 17, 2025 3:32 pm

if your goal was to get this into upstream ogre, it would be better to commit the individual changes on top of upstream master instead of having one "Initial commit: .." with everything.

Thank you very much for the quick feedback and suggestions!
I'll prepare a proper Pull Request soon and link it here for review.
Thanks again for your time!
ycsqwan


Re: OGRE port to LoongArch64 with LSX SIMD optimizations (tested on Loongson 3B6000M)

Posted: Wed Dec 17, 2025 4:50 pm
by ycsqwan
paroj wrote: Wed Dec 17, 2025 3:32 pm

if your goal was to get this into upstream ogre, it would be better to commit the individual changes on top of upstream master instead of having one "Initial commit: .." with everything.

Thanks again! I've opened the PR with clean commits:

https://github.com/OGRECave/ogre/pull/3520

Looking forward to any feedback!

ycsqwan