Skip to content

Instantly share code, notes, and snippets.

@spundun
Last active June 22, 2022 17:51
Show Gist options
  • Save spundun/0fefb599352ef0082883512ce9a4c5bd to your computer and use it in GitHub Desktop.
Save spundun/0fefb599352ef0082883512ce9a4c5bd to your computer and use it in GitHub Desktop.
Patch to include new Venus/Virtio Vulkan Driver in mesa packages. This lets you use Vulkan 3D graphics capabilities from a virtual machine like Crostini on ChromeOS
commit 0907c0b16eb95bedc89f6131a0723cbb17ca862d
Author: Spundun Bhatt <[email protected]>
Date: Sat Jun 11 07:45:05 2022 -0700
Include virtio driver in lib32-mesa
diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD
index 944a3c4..1b9f886 100644
--- a/trunk/PKGBUILD
+++ b/trunk/PKGBUILD
@@ -4,7 +4,7 @@
# Contributor: Andreas Radke <[email protected]>
pkgbase=lib32-mesa
-pkgname=('lib32-vulkan-mesa-layers' 'lib32-opencl-mesa' 'lib32-vulkan-intel' 'lib32-vulkan-radeon' 'lib32-libva-mesa-driver' 'lib32-mesa-vdpau' 'lib32-mesa')
+pkgname=('lib32-vulkan-mesa-layers' 'lib32-opencl-mesa' 'lib32-vulkan-intel' 'lib32-vulkan-radeon' 'lib32-vulkan-virtio' 'lib32-libva-mesa-driver' 'lib32-mesa-vdpau' 'lib32-mesa')
pkgdesc="An open-source implementation of the OpenGL specification (32-bit)"
pkgver=22.1.2
pkgrel=1
@@ -60,7 +60,7 @@ END
-D b_ndebug=true \
-D platforms=x11,wayland \
-D gallium-drivers=r300,r600,radeonsi,nouveau,virgl,svga,swrast,iris,crocus,zink \
- -D vulkan-drivers=amd,intel \
+ -D vulkan-drivers=amd,intel,virtio-experimental \
-D vulkan-layers=device-select,intel-nullhw,overlay \
-D dri3=enabled \
-D egl=enabled \
@@ -160,6 +160,19 @@ package_lib32-vulkan-radeon() {
install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
}
+package_lib32-vulkan-virtio() {
+ pkgdesc="Venus Vulkan mesa driver (32-bit)"
+ depends=('lib32-wayland' 'lib32-libx11' 'lib32-libxshmfence' 'lib32-libdrm' 'lib32-zstd'
+ 'lib32-systemd')
+ optdepends=('lib32-vulkan-mesa-layers: additional vulkan layers')
+ provides=('lib32-vulkan-driver')
+
+ _install fakeinstall/usr/share/vulkan/icd.d/virtio_icd*.json
+ _install fakeinstall/usr/lib32/libvulkan_virtio.so
+
+ install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
+}
+
package_lib32-libva-mesa-driver() {
pkgdesc="VA-API implementation for gallium (32-bit)"
depends=('lib32-libdrm' 'lib32-libx11' 'lib32-llvm-libs' 'lib32-expat' 'lib32-libelf'
commit 61ab00be87c889e3811c5e775e7e3bed93f4c5a7
Author: Spundun Bhatt <[email protected]>
Date: Fri Jun 10 10:12:05 2022 -0700
Add virtio driver to mesa
diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD
index 57016b19024..cc0a0b31260 100644
--- a/trunk/PKGBUILD
+++ b/trunk/PKGBUILD
@@ -4,7 +4,7 @@
# Contributor: Andreas Radke <[email protected]>
pkgbase=mesa
-pkgname=('vulkan-mesa-layers' 'opencl-mesa' 'vulkan-intel' 'vulkan-radeon' 'vulkan-swrast' 'libva-mesa-driver' 'mesa-vdpau' 'mesa')
+pkgname=('vulkan-mesa-layers' 'opencl-mesa' 'vulkan-intel' 'vulkan-radeon' 'vulkan-swrast' 'vulkan-virtio' 'libva-mesa-driver' 'mesa-vdpau' 'mesa')
pkgdesc="An open-source implementation of the OpenGL specification"
pkgver=22.1.2
pkgrel=1
@@ -46,7 +46,7 @@ build() {
-D b_ndebug=true \
-D platforms=x11,wayland \
-D gallium-drivers=r300,r600,radeonsi,nouveau,virgl,svga,swrast,iris,crocus,zink,d3d12 \
- -D vulkan-drivers=amd,intel,swrast \
+ -D vulkan-drivers=amd,intel,swrast,virtio-experimental \
-D vulkan-layers=device-select,intel-nullhw,overlay \
-D dri3=enabled \
-D egl=enabled \
@@ -144,6 +144,18 @@ package_vulkan-radeon() {
install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
}
+package_vulkan-virtio() {
+ pkgdesc="Venus Vulkan mesa driver for Virtual Machines"
+ depends=('wayland' 'libx11' 'libxshmfence' 'libdrm' 'zstd' 'systemd-libs')
+ optdepends=('vulkan-mesa-layers: additional vulkan layers')
+ provides=('vulkan-driver')
+
+ _install fakeinstall/usr/share/vulkan/icd.d/virtio_icd*.json
+ _install fakeinstall/usr/lib/libvulkan_virtio.so
+
+ install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
+}
+
package_vulkan-swrast() {
pkgdesc="Vulkan software rasteriser driver"
depends=('wayland' 'libx11' 'libxshmfence' 'libdrm' 'zstd' 'llvm-libs' 'systemd-libs' 'libunwind')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment