Skip to content
NightFox edited this page Feb 27, 2023 · 6 revisions

Introduction

(as of 2021-02-11) Vulkan renderer also runs on Raspberry Pi 4, although right now it's a bit slower than ref_gl (30fps vs 45fps).

Instructions

Build and install mesa with Vulkan driver for VC6

There's no Vulkan driver in official mesa packages provided by Raspbian yet, so you have to build it yourself. (taken from https://qengineering.eu/install-vulkan-on-raspberry-pi.html)

sudo apt install libxcb-randr0-dev libxrandr-dev libxcb-xinerama0-dev \
libxinerama-dev libxcursor-dev libxcb-cursor-dev libxkbcommon-dev \
xutils-dev xutils-dev libpthread-stubs0-dev libpciaccess-dev libffi-dev \
x11proto-xext-dev libxcb1-dev 'libxcb-*dev' bison flex libssl-dev \
libgnutls28-dev x11proto-dri2-dev x11proto-dri3-dev libx11-dev \
libxcb-glx0-dev libx11-xcb-dev libxext-dev libxdamage-dev libxfixes-dev \
libva-dev x11proto-randr-dev x11proto-present-dev libclc-dev libelf-dev \
git build-essential mesa-utils libvulkan-dev ninja-build libvulkan1 \
python-mako libdrm-dev libxshmfence-dev libxxf86vm-dev libunwind-dev \
libzstd-dev vulkan-tools vulkan-utils ninja-build
sudo pip3 install meson mako

cd ~
git clone https://gitlab.freedesktop.org/mesa/mesa.git mesa_vulkan
cd mesa_vulkan
# Assuming you're running regular 32-bit raspbian
CFLAGS="-mcpu=cortex-a72 -mfpu=neon-fp-armv8" CXXFLAGS="-mcpu=cortex-a72 -mfpu=neon-fp-armv8" \
  meson --prefix /usr/local \
  -D platforms=x11 \
  -D vulkan-drivers=broadcom \
  -D dri-drivers= \
  -D gallium-drivers=kmsro,v3d,vc4 \
  -D buildtype=release build

# Takes about 15 minutes
ninja -C build
sudo ninja -C build install

Build Xash3D

  1. Build it as usual, with hlsdk-xash3d and copying hl/client_armv6hf.so so from dll and cl_dlls into corresponding dirs under valve/, getting official valve HL1 data, etc etc
  2. Copy build spv shaders from your desktop to valve/
  3. Enjoy low fps and no models LD_LIBRARY_PATH=. ./xash3d -log -dev 2 -ref vk