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

Problems building or running the engine, queries about how to use features etc.
ycsqwan
Gnoblar
Posts: 3
Joined: Wed Dec 17, 2025 11:59 am

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

Post 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

paroj
OGRE Team Member
OGRE Team Member
Posts: 2274
Joined: Sun Mar 30, 2014 2:51 pm
x 1239

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

Post 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.

paroj
OGRE Team Member
OGRE Team Member
Posts: 2274
Joined: Sun Mar 30, 2014 2:51 pm
x 1239

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

Post by paroj »

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

Code: Select all

cmake -DCMAKE_CXX_FLAGS="-march=loongarch64 -mlsx" ...
ycsqwan
Gnoblar
Posts: 3
Joined: Wed Dec 17, 2025 11:59 am

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

Post 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

ycsqwan
Gnoblar
Posts: 3
Joined: Wed Dec 17, 2025 11:59 am

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

Post 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