Skip to content

A MetalVR route for Steam games, and MULLION_METALVR for what it runs - #804

Merged
aaf2tbz merged 5 commits into
mainfrom
feat/metalvr-lane
Nov 17, 2026
Merged

aaf2tbz merged 5 commits into
mainfrom
feat/metalvr-lane

Conversation

@aaf2tbz

@aaf2tbz aaf2tbz commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

What this adds

Two commits:

  1. A MetalVR route for Steam games, with the VR server started from the game's hero. MetalVR gets a route of its own in the pipeline menu of Steam games on both runtimes; a "Start VR Server" button beside the hero's settings starts metalvrd and turns into "Exit VR Server". The x86_64 runtime's Steam client runs on Mullion too, as FEX's already does, so SteamVR's compositor shares textures with MetalVR's driver.
  2. MULLION_METALVR for Wine programs while MetalVR is installed. Mullion shares Direct3D 11 buffers and Direct3D 12 textures between processes only for a VR runtime, which says so with this variable. SteamVR and the games Steam starts inherit the Steam client's environment, so it is set for every Wine program started here while ~/.metalsharp/metalvr-runtime has metalvrd, and unset otherwise.

Depends on

What was run

  • The backend builds with -Werror (make in app/src-c).
  • With the same variable supplied through ~/.metalsharp/debug/wine-env, and the Mullion build from the PR above, ABE VR shows through SteamVR on a Rift CV1 (FEX runtime).

Not run

  • The backend's test suite (make test).
  • The app was not rebuilt or installed with the second commit, so the variable being set by this code path, rather than by the debug file, is untested.
  • The x86_64 runtime with the new Mullion build.

…game's hero

MetalVR (an OpenXR runtime and SteamVR driver for headsets on a Mac) gets a
route of its own in the pipeline menu of Steam games, beside Mullion, on both
runtimes. When it is chosen, a "Start VR Server" button sits to the right of
the hero's settings button: it starts metalvrd and turns into "Exit VR
Server", so the server never outlives what the user asked for.

- The backend's /metalvr/status, /metalvr/start and /metalvr/stop run
  ~/.metalsharp/metalvr-runtime/bin/metalvrd (the driver named in
  ~/.metalsharp/metalvr/driver, a Rift by default), detached, logging to
  logs/metalvrd.log. Starting it asks once for Screen Recording, which the
  headset uses to show a starting game's window, and makes MetalVR the Steam
  prefix's OpenXR runtime and SteamVR's headset driver.
- A game on the route launches as on Mullion, after checking the server is
  up, and through the game's VR launch entry (steam://launch/<id>/VR), as
  SteamVR's own library starts it.
- The x86_64 runtime's Steam client runs on Mullion too, as FEX's already
  does, so SteamVR's compositor shares textures with the driver. Switching a
  running client to that lane restarts it when no Wine program is running.
- ~/.metalsharp/debug/wine-env, when present, puts its MTL_* and MULLION_*
  lines in the environment of the Wine programs the backend starts, Steam
  included: for a Metal capture of a process the user can't start themself.
Mullion shares Direct3D 11 buffers and Direct3D 12 textures between processes
only for a VR runtime, which says so with MULLION_METALVR. SteamVR's
compositor and the games it shows pass each other their frames' bookkeeping
that way: without it a SteamVR game runs but is black in the headset.

The variable is set for every Wine program started here while
~/.metalsharp/metalvr-runtime has metalvrd, the Steam client included, since
SteamVR and the games Steam starts take their environment from it. Without
MetalVR it is unset, and Mullion behaves as it does for everything else.
@aaf2tbz
aaf2tbz merged commit 677151b into main Nov 17, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant