Overview

The Mesa Zink driver is a Gallium driver that translates OpenGL calls into Vulkan. When used with RetroArch, it can provide improved performance and stability compared to the default Mesa OpenGL driver.

This is particularly useful for emulating older DOS or Windows games with 3dfx hardware support, where enabling the 3dfx mode allows Zink to handle rendering more efficiently.

Use Cases

  • DOS/Windows games with 3dfx support
Zink can be used to provide hardware-accelerated 3dfx support, serving as an alternative to the default Mesa OpenGL driver.
Benefits include:
  • Better performance in certain scenarios
  • Increased stability during emulation

Launching RetroArch with Zink

RetroArch can be launched with the Zink driver by setting the following environment variables:

vblank_mode=0 LIBGL_KOPPER_DRI2=1 MESA_LOADER_DRIVER_OVERRIDE=zink GALLIUM_DRIVER=zink __GLX_VENDOR_LIBRARY_NAME=mesa /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=retroarch --file-forwarding org.libretro.RetroArch -v
  • -v enables verbose logging (useful for debugging).

Debugging Zink

To verify that Zink is working, set the following environment variable:

ZINK_DEBUG=nir

Then check the RetroArch log for references to NIR shaders, which confirm Zink is active.

Vsync Considerations

RetroArch requires maximum framerate flexibility to properly emulate specific hardware. Since Zink operates through Vulkan, Vsync must be disabled to avoid performance issues.

Disable Vsync with:

vblank_mode=0

Notes

  • Zink is layered on top of Vulkan, so system Vulkan support is required.
  • Debugging options are primarily for advanced users and may reduce performance.