about summary refs log tree commit diff
path: root/pkgs/development/libraries/mesa/llvmpipe-hook.sh
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/mesa/llvmpipe-hook.sh')
-rw-r--r--pkgs/development/libraries/mesa/llvmpipe-hook.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/pkgs/development/libraries/mesa/llvmpipe-hook.sh b/pkgs/development/libraries/mesa/llvmpipe-hook.sh
new file mode 100644
index 0000000000000..6217182b15e89
--- /dev/null
+++ b/pkgs/development/libraries/mesa/llvmpipe-hook.sh
@@ -0,0 +1,14 @@
+# shellcheck shell=bash
+
+# https://docs.mesa3d.org/envvars.html
+export LIBGL_ALWAYS_SOFTWARE=true
+export LIBGL_DRIVERS_PATH=@drivers@/lib/dri
+
+# https://github.com/NVIDIA/libglvnd/blob/master/src/EGL/icd_enumeration.md
+export __EGL_VENDOR_LIBRARY_FILENAMES=@drivers@/share/glvnd/egl_vendor.d/50_mesa.json
+
+# https://github.com/KhronosGroup/Vulkan-Loader/blob/main/docs/LoaderInterfaceArchitecture.md
+# glob because the filenames contain an architecture suffix
+# echo is needed to force-expand the glob
+VK_DRIVER_FILES="$(echo @drivers@/share/vulkan/icd.d/lvp_icd.*.json)"
+export VK_DRIVER_FILES