Turnip+Zink in ExaGear
Turnip+Zink in ExaGear Windows Emulator is used as one of the methods to achieve full hardware acceleration for the new Adreno GPUs using xlib (an X Window System client function library written in C language). dri3 does not currently support hardware acceleration due to limitations of the ExaGear X server.
For a list of GPU Adreno that support Turnip+Zink drivers, see here.
The Turnip, Zink drivers are part of the Mesa driver, a free implementation of the Vulkan, OpenGL API.
This article shows instructions for compiling Mesa with Turnip+Zink and then installing the compiled libraries in ExaGear Windows Emulator.
ExaGear RPG/Strategies cannot use Turnip+Zink.
Install prebuilt libraries for ExaGear Turnip+Zink
In the current (released since December 2021) modified caches Turnip+Zink is built-in, they can be installed in the "Start" menu
If a cache is used where Turnip+Zink is not included in the .obb, it is easiest to use auto-installers created with WinRAR(SFX archives) to install Turnip+Zink data. You can download them here.
Build Mesa with Turnip+Zink for manual use in ExaGear (for modders)
Attention! Basic knowledge of GNU/Linux required.
This part of the article shows instructions for building the Turnip+Zink libraries manually, followed by installation and use in ExaGear.
To do this, you need to have a computer or laptop with i386 (not x86_64, because ExaGear Windows Emulator only supports translation to ARM 32-bit code) GNU/Linux operating system.
This manual will use Debian 12(sid) to build the latest version.
Install dependencies
First, open the /etc/apt/sources.list
file with a text editor. Copy lines like deb http://ftp.ua.debian.org/debian/ bookworm main
and paste them already with deb-src
, e.g. deb-src http://ftp.ua.debian.org/debian/ bookworm main
If deb-src
is already in your sources.list
then you don't need to edit anything.
Save the changes and issue the command sudo apt update
, after updating the packages, install the dependencies for the Mesa build: sudo apt build-dep mesa -y
Download Mesa3D and Zink-Mesa-Xlib
Because X Server ExaGear Windows Emulator only works correctly with xlib (the X Window System client function library written in C), and not with dri(Direct Rendering Infrastructure), then for Zink to work in ExaGear you need a patched version by user alexvorxx Mesa
Install git if not installed: sudo apt install git -y
and clone the Mesa3D and Zink-Mesa-Xlib repositories:
git clone https://github.com/mesa3d/mesa
(any repository with mesa 22.git clone https://github.com/alexvorxx/Zink-Mesa-Xlib
For those using Debian 11(and below) or Ubuntu 18.04
If you are using Debian 11 and below, or Ubuntu 18.04, then before building mesa, you need to compile the latest versions of the programs listed below:
- to https://gitlab.freedesktop.org/glvnd/libglvnd
- https://dri.freedesktop.org/libdrm
- https://gitlab.freedesktop.org/wayland/wayland
- https://gitlab.freedesktop.org/wayland/wayland-protocols
These repositories can also be cloned using git clone
, build instructions are in the README.
For those using Ubuntu 18.04
Since the repositories in Ubuntu 18.04 use the old version of meson, you need to install it from pip3 using python3.6, to install it, enter the commands below in sequence:
sudo apt-get install python3-pip
pip3 install meson ninja
Build mesa
After building the necessary dependencies, go to the folder and build mesa
:
meson build -D platforms=x11,wayland -D gallium-drivers=swrast,zink -D vulkan-drivers=freedreno -D dri3=enabled -D egl=enabled -D gles2=enabled -D glvnd=true -D glx=dri -D libunwind=disabled -D osmesa=true -D shared-glapi=enabled -D microsoft-clc=disabled -D valgrind=disabled --prefix /usr -D gles1=disabled -D freedreno-kgsl=true - Dbuildtype=release && sudo ninja -C build
If during compilation there will be an error about the missing file drm.h, drm_mode.h, copy these files to /usr/include
:
sudo cp /usr/include/libdrm/drm.h /usr/include
sudo cp /usr/include/libdrm/drm_mode.h /usr/include
Build Zink-Mesa-Xlib
After installing mesa, go to the Zink-Mesa-Xlib folder, and build Mesa with Zink:
meson. build -Dgallium-va=false -Ddri-drivers= -Dgallium-drivers=virgl,zink,swrast -Ddri3=true -Dvulkan-drivers= -Dglx=xlib -Dplatforms=x11 -Dbuildtype=release && sudo ninja -C build install
After compilation, the compiled libraries need to be installed in ExaGear Windows Emulator
Installation in ExaGear
mesa
You need to create a folder usr
, and create 3 more folders there (share, lib, include).
include
Copy the gbm.h file (located in ~/mesa/src/gbm/main) to the include folder.
Copy these directories to the usr/include folder: EGL, GL, GLES, GLES2, GLES3, KHR (located in ~/mesa/include)
In share folder create folder vulkan, glvnd, drirc.d, in folder vulkan create folder icd.d, in glvnd folder create folder egl_vendor.d.
In the vulkan/icd.d folder, copy the freedreno_icd.i686.json file (located in ~/mesa/build/src/freedreno/vulkan)
In glvnd/egl_vendor.d/ folder copy 50_mesa.json (located in ~/mesa/build/src/egl)
Copy the 00-mesa-defaults.conf file to the drirc.d folder (located in ~/mesa/src/util)
lib
In the lib folder, create the i386-linux-gnu folder and copy the files there:
- libglapi.so, libglapi.so.0, libglapi.so.0.0.0 (located in ~/mesa/build/src/mapi/shared-glapi)
- libvulkan_freedreno.so (located in ~/mesa/build/src/freedreno/vulkan)
- libOSMesa.so.8.0.0, libOSMesa.so, libOSMesa.so.8 (found in ~/mesa/build/src/gallium/targets/osmesa)
- libGLX_mesa.so.0.0.0, libGLX_mesa.so, libGLX_mesa.so.0 (found in ~/mesa/build/src/glx/)
- libEGL_mesa.so.0.0.0, libEGL_mesa.so, libEGL_mesa.so.0 (located in ~/mesa/build/src/egl)
- libgbm.so, libgbm.so.1, libgbm.so.1.0.0 (located in ~/mesa/build/src/gbm/)
Also create pkgconfig and dri folders in the same lib folder. Copy the following files to the pkgconfig folder:
- osmesa.pc (located in ~/mesa/build/meson-private/)
- gbm.pc (located in ~/mesa/build/meson-private/)
- dri.pc (located in ~/mesa/build/meson-private/)
Copy these files to the dri folder:
- zink_dri.so (located in ~/mesa/build/src/gallium/targets/dri)
- libgallium_dri.so (located in ~/mesa/build/src/gallium/targets/dri)
Zink-Mesa-Xlib
lib
From the folder Zink-Mesa-Xlib you need to copy the libGL.so.1.5.0 library (located in ~/mesa/build/src /gallium/targets/libgl-xlib/)
Validation in ExaGear
After copying all the files, you need to copy the usr folder to the Download folder of the phone, then run ExaGear Windows Emulator, and copy the copied folder to the Z: / drive with overwriting.
If the standard ExaGear cache is used (which is not recommended) then it must be modified by adding the vulkan-tools
package. How to modify the cache and add packages to it is described in here. You also need to download terminal emulator for ExaGear.
Open a terminal and enter the command vulkaninfo
(if you use the original ExaGear Windows Emulator cache and there is a missing libraries error, you need to download and install them additionally). After all the errors have been fixed and the vulkaninfo
command has run successfully and the Vulkan API and GPU name extensions should be shown (or the TU error will be shown, in this case Vulkan will also work).
You also need to check OpenGL (type glxgears,
should show gears). If gears are displayed, then Turnip+Zink is working. If you get an error that the command was not found, run the Wine ported to Windows wglgears in Wine.
If you get an error when starting glxgears instead of gears (wglgears will close), then you may have an unsupported GPU, you can see the list of GPUs that can work with Turnip+Zink here.