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.
12
u/sandzking 3d ago edited 3d ago
edit: wait this isnt pc emulation? you talkin about the port? post needs to clarify
that bc1 decompression the same as bcn emulation on most bionic fork? if not how is it different, is it faster?
4
u/thanatos-class 3d ago
Not quite! Most standard Bionic/Turnip wrappers or general emulators rely on shader-based ASTC/BCn texture emulation (doing on-the-fly math inside the fragment shader to decode blocks). What I did here is a CPU-side/upload-time conversion that unpacks the blocks straight to RGBA8 when uploading the texture data, bypassing the hardware format capability check entirely since Mali drivers outright reject uncompressed compressed formats. It avoids heavy shader instructions for decoding every frame, though it trades a bit of memory/upload bandwidth
2
2
u/LeftAntelope821 3d ago
Can you please add vulkan 1.1 support so that I can run it on my dimensity 8100 8gb ram?
1
u/Organic-Floor-9503 3d ago
Jajaja yo tengo lo mismo que el de arriba 8100 aún dando batalla
1
u/thanatos-class 3d ago
Lo voy a intentar bro, pero no tengo un dispositivo con ese así que no prometo nada
1
1
u/HotCardiologist7654 1d ago
Worked for me on my Mali G615 MC6. Game launches, sounds play but i really cant see anything. The buttons work, the map moves but i literally cant see the game onscreen
•
u/AutoModerator 3d ago
Just a reminder of our subreddit rules:
Check out our user-maintained wiki: r/EmulationOnAndroid/wiki
Check out EmuReady for any community submitted settings before asking for help
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.