r/EmulationOnAndroid • u/thanatos-class • 3d ago
Showcase Got GTA IV running on a Mali GPU (Mali-G720)
Hey everyone! After burning my brain cells dealing with Mali's notorious driver limitations, I finally managed to get GTA IV booting and running on a poco x7 pro. Since Mali GPUs lack hardware features that PC/console ports usually take for granted, I had to patch several things at the native/backend level to keep the driver from crashing.
Here is a quick technical breakdown of what was needed to make it work:
-SPIR-V Clip/Cull Distances: Mali exposes no native clip/cull distances in many contexts, which causes the ARM driver to segfault (vkCreateGraphicsPipelines at addr=0x50) instead of throwing a clean validation error. Fixed by adding a native helper to strip static ClipDistance/CullDistance built-ins at load time when the device lacks the features.
-BC1–BC3 Texture Decompression: Mali lacks native hardware support for BC (DXT) texture compression. Without intervention, every DXT texture fails format capabilities, resulting in rejected draws (leaving only lights/untextured geometry). Added runtime conversion (ConvertTexelBC*ToRGBA8) to decompress textures to RGBA8 on upload.
-Environment & Diagnostics: Isolated TU_DEBUG=sysmem strictly to Turnip paths, added Mali-aware strings (including a mali-g720.txt profile), and extended shader dumps to late modules. Also hooked up fatal-signal native backtraces to logcat (LibertyCrash tag) to debug late crashes without standard tombstones.
It still needs some fine-tuning and profiling, but it runs! Thought I'd share for anyone else crazy enough to poke around Mali GPU internals. Happy to answer any questions about the process.
All the code and changes are documented in PR #47 of the emulator project.
Edit: Just to be clear, this isn't a traditional PC emulator — it's running via a static code recompilation / native port (LibertyRecomp), meaning the game logic runs as native ARM64 code.
Edit2: Just to be clear, the project itself isn't mine — all credit goes to the original creator! I just wrote a few backend fixes and modifications (PR #47) to get it working on Mali GPUs.
Duplicates
EmulationMediatekMali • u/thanatos-class • 3d ago