Turnip KGSL + Zink (via Xlib) on Exagear (Android) - GL_OUT_OF_MEMORY in some games
- OS: Android 9
- GPU: Qualcomm Adreno 630
- Kernel version: 4.9.112-perf-g526fc33
- Mesa version: 22.1.0-devel
- Xserver version: ExaGear Emulator X Server (unknown implementation)
- Wine/Proton version: Wine 6.0 inside ExaGear (x86 Emulator)
Describe the issue
I recently succeeded to implement direct 3D GPU acceleration in Exagear Windows Emulator for Android (an x86 emulator which emulates an Ubuntu x86 system with Wine installed on it to run x86 Windows games on Android). For this, the x86 libraries of Mesa Turnip KGSL driver was assembled.
Also, to get OpenGL support in Exagear, x86 libraries of Mesa Zink was assembled working through Xlib. To successfully build and fix the context error, I had to make the following small changes in the code:
Turnip + Zink works well in many OpenGL and DirectX8/9 tests, but periodically some games crash on loading. This is accompanied by errors in the log: VK_ERROR_MEMORY_MAP_FAILED, GL_OUT_OF_MEMORY in glTexSubImage, GL_OUT_OF_MEMORY in glCompressedTexSubImage2D, GL_OUT_OF_MEMORY in glGetCompresssedTexImage and similar. Also noticed that errors appear less often if use ZINK_DESCRIPTORS=lazy command.
A list of games/tests includes:
Tests wglgears, Furmark, GPU Caps Viewer (OpenGL) - works fine;
Tests CubeMap, SphereMap, StencilMirror (DX9) - works fine;
Half Life, Cry of Fear, Hitman Contracts (OpenGL), Half Life 2, Dead Space, Alan Wake (DX9) - works fine;
Portal Reloaded, The Stanley Parable, SCP Containment Breach (DX9) - periodically crash when loading a new game;
GTA IV, Battlefield 1942, Serious Sam 3 (DX9) - only renders a black screen on loading (or freezes).
Log files as attachment
A typical log, when game crashes x86-stderr.txt