Files
marfrit-packages/arch/mesa-panvk-bifrost
marfrit 902e855d92 mesa-panvk-bifrost: iter13 — implement VK_EXT_transform_feedback for Bifrost
iter12 hit a wall: Brave's ANGLE-Vulkan path requires GLES3, which
requires VK_EXT_transform_feedback, which PanVk-Bifrost did not
implement. This iter implements that extension, unlocking the full
ANGLE-Vulkan-on-Bifrost stack.

The implementation follows Panfrost-Gallium's well-validated XFB lowering
(nir_io_add_intrinsic_xfb_info + pan_nir_lower_xfb) wired into the PanVk
shader pipeline after nir_lower_io. Adds 4 XFB buffer address sysvals
plus per-draw num_vertices to the graphics sysval struct. Buffer state
is tracked on the cmd buffer; per-draw sysval upload populates either
the bound buffer's GPU address or PAN_SHADER_OOB_ADDRESS (memory-sink)
so XFB-capable pipelines used outside Begin/End survive without GPU
fault — the Panfrost-Gallium idiom from gallium/drivers/panfrost/
pan_cmdstream.c:1350.

Verified on PineTab2 (Mali-G52 r1 MC1, RK3566):
- /tmp/panvk-iter13/probe_xfb: 3 vertices captured byte-exact
- /tmp/panvk-iter13/probe_xfb_nodraw: XFB pipeline used without Bind/
  Begin/End survives — DEVICE_LOST regression closed
- Brave 148 with --use-angle=vulkan: WebGL 2.0 (OpenGL ES 3.0) creates
  cleanly, renderer reports
  "ANGLE (ARM, Vulkan 1.2.335 (Mali-G52 r1 MC1), panvk)"
- chrome://gpu graphics feature status: Canvas/Compositing/OpenGL/
  Rasterization/WebGL/WebGL2/WebGPU/Video Decode all hardware accelerated

Phase docs:
- ~/src/panvk-bifrost/phase4_iter13_close.md  (build green)
- ~/src/panvk-bifrost/phase5_iter13_close.md  (review fixes applied)
- ~/src/panvk-bifrost/phase6_iter13_close.md  (Brave integration green)

pkgver bumped 26.0.6.r2 -> 26.0.6.r3; iter13 patch applied via
unified-diff (the 328-line change scope is past sed-of-individual-
lines territory). Sanity checks in prepare() verify the patch landed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 19:13:05 +02:00
..

mesa-panvk-bifrost

Patched Mesa libvulkan_panfrost.so exposing Bifrost-gen Mali GPUs (Mali-G31/G52/G72/G76, PAN_ARCH 6/7) to Chromium-family browsers' Vulkan compositor.

Result of the panvk-bifrost campaign (~/src/panvk-bifrost/), iter9 close 2026-05-20 (technical milestone — operator-confirmed Brave window) followed by this package as the actual delivery.

What it solves

Stock Chromium / Brave on Bifrost SBCs (PineTab2, etc.) currently dies at GL bindings init:

ERROR: ui/gl/gl_context_egl.cc:120  GLES3 is unsupported and ES version fallback is disabled
ERROR: ui/gl/init/gl_factory.cc:111  Requested GL implementation not found
ERROR: components/viz/service/main/viz_main_impl.cc:189  Exiting GPU process due to errors during initialization

This package makes Brave's Vulkan compositor path work on Bifrost, side-stepping the failing GL stack. Browser chrome and standard page rendering work.

Known limitations (not addressed)

  • WebGL / WebGL2 in-page: blocked. ANGLE needs VK_EXT_transform_feedback to expose GLES3 contexts; PanVk-Bifrost doesn't currently support that. Sites using WebGL will degrade or refuse.
  • VAAPI hardware video decode: unrelated to this package — see the libva-v4l2-request-fourier package for that path.

Install

# Ensure [marfrit] is in /etc/pacman.conf, then:
sudo pacman -Sy mesa-panvk-bifrost

Use

brave-vulkan                                    # launches Brave with Vulkan
brave-vulkan https://www.example.com
brave-vulkan --your-flags-here                  # extra args passed through

The launcher sets:

  • VK_ICD_FILENAMES=/usr/lib/panvk-bifrost/icd.json (the patched driver)
  • PAN_I_WANT_A_BROKEN_VULKAN_DRIVER=1 (Mesa upstream gate)
  • MESA_VK_VERSION_OVERRIDE=1.2 (apiVersion bump for ANGLE)
  • Brave flags: --use-gl=disabled --enable-features=Vulkan --use-vulkan=native --ozone-platform=x11 --no-sandbox --disable-gpu-sandbox --ignore-gpu-blocklist

What's in the package

  • /usr/lib/panvk-bifrost/libvulkan_panfrost.so — patched Mesa Vulkan driver (Mesa 26.0.6 + 2 sed-applied patches)
  • /usr/lib/panvk-bifrost/icd.json — Vulkan ICD JSON pointing at the patched .so (NOT auto-loaded; only via VK_ICD_FILENAMES)
  • /usr/bin/brave-vulkan — launcher script

System Mesa is untouched. The stock /usr/lib/libvulkan_panfrost.so and /usr/share/vulkan/icd.d/panfrost_icd.json continue to work for any other Vulkan app.

Co-existence

Both stock Mesa and this package can be installed. Stock Vulkan apps (vulkaninfo, vkcube, etc.) use the stock driver by default. Only apps started via brave-vulkan (or with VK_ICD_FILENAMES manually set to our path) use the patched driver.

Campaign close criterion

Per feedback_package_done_means_installable three-point check:

  1. PR merged to marfrit-packages
  2. CI green AND packages.reauktion.de/arch/aarch64/mesa-panvk-bifrost-*.pkg.tar.zst exists
  3. pacman -Ss mesa-panvk-bifrost on a fresh consumer host (e.g. ohm after pacman -Syu from clean state) returns the package + brave-vulkan launches

When all three pass, panvk-bifrost iter9 closes.