feat(vr): play in a PC VR headset over OpenXR, with a VR tab in the Insert menu #204

Open
airdamien wants to merge 11 commits from airdamien/Longshot:feat/vr-openxr into main
First-time contributor

Type: feat · Risk: high · Tested on: Windows 11, RTX 5080, Meta Quest 3 over Link · Needs: Windows with AMD or Intel, Linux, other headsets

Why

Longshot can only be played on a monitor. This lets it be played in a PC VR headset (tested with a Meta Quest 3 over Quest Link): either on a big flat screen in front of you, or in stereo 3D with the game's camera at your eyes. No issue in the tracker asks for it (searched: "VR", "headset", "OpenXR", "Quest").

What changed

The renderer can run through OpenXR: with VR on, the game shows on a big screen in the headset, or in stereo 3D with one eye drawn a frame and the two eyes handed to the headset as a pair, the HUD on a panel in front of you and the Touch controllers as a gamepad. A VR tab in the Insert menu holds its settings (kept in longshot_vr.ini). With VR off, the default, nothing of it runs.

  • vr: gpu/vk/vk_xr.cpp / vk_xr.h (new). The renderer's instance and device are made through OpenXR (XR_KHR_vulkan_enable2) when VR is on. Flat-screen mode shows every presented picture on a quad layer. Stereo mode draws one eye a frame (xr_view), matches frames to eyes by the scene camera (xr_note_scene_draw), holds a pair's first eye until its second and gives both to the headset together (xr_copy_acquire, publish_held), one pair per xrWaitFrame (xr_thread). The HUD is redirected to a head-locked panel (xr_hud_draw), with its middle (the aiming reticle) shown where the game aims. A first-person view (left-stick tap or F9). The Touch controllers as a virtual SDL gamepad (pad_attach). On Linux the file is stubs (xr_built() false): it is Win32 only for now.
  • vr: no headset for a run with no game window (--prepare-shaders, HOS_HEADLESS): xr_wanted().
  • vk: hooks in vk_main.cpp (instance, device, shutdown), vk_replay.cpp (present_image: the copies to the headset, the window's mirror), vk_draw.cpp (HUD and scene-camera notes), vk_temporal.cpp (a DLSS/FSR history per eye), vk_framegen.cpp (no made frames with a headset).
  • menu: a VR tab in gpu/vk/vk_menu.cpp. Row::apply is new: a row kept outside the options file (these are kept in longshot_vr.ini, written by xr_opt_changed).
  • runtime: host/hos_main.c hos_oot_free_view hands the game the headset's view and field of view; host/nn_vi.c realtime_step steps the game in pairs of frames while stereo runs (both eyes one moment); host/rx_backend.c looks up the renderer's optional mkwvk_xr_* exports.
  • lift: nx2/oot_wide.py (the projection's field of view at the five matrix-update sites), nx2/oot_patches.py (the step hook records the step a frame read).
  • build: nx2/build.py adds third_party/openxr/include, and copies Khronos' openxr_loader.dll beside the game when the tools have it (LONGSHOT_OPENXR_LOADER); nx2/make_game.py carries it into the game folder (BESIDE). quest/build_vk.ps1 builds the renderer alone and installs it with the loader.
  • tools: tools.lock has a line for Khronos' loader (openxr-loader, Khronos' own release archive, Apache-2.0, SHA-256 pinned), so the Builder downloads it with its other tools; builder/LongshotBuilder/Runner.cs passes its folder to the build. Nothing of it is committed or packaged in a release.
  • third_party: third_party/openxr (Khronos' headers, Apache-2.0, unmodified, with PROVENANCE.md).
  • docs: quest/README.md, the README's VR rows, the switches in docs/development.md.
  • tests: stubs for the new calls in the fixtures that read the changed functions; tests/test_readme_menu_rows.py covers the VR tab.

Measurements

Verdict: no cost with VR off, the default: the frame times are main's within run-to-run noise (median 16.65-16.66 ms against 16.64-16.65 ms, the game at its 60 fps cap in every run). VR itself is measured in a headset only in the earlier runs below.

Hardware: Windows 11, NVIDIA GeForce RTX 5080 16 GB (driver 591.59), Intel Core Ultra 9 285K, 32 GB
Scene: Castle Town's gate by day from a test save, Link standing still; the defaults of a new game folder (2560x1440 output, DLSS, no frame generation, the game's frame rate cap 60, windowed, V-Sync off); VR off (RX_VR=0)
Method: 150 s runs, the first 60 s left out, two runs each interleaved with main; RX_VK_FRAME_LOG's frame times, a line per present; the game's own rate from the log's vi: line; HOS_INPUT_EXCLUSIVE=1 so only the scripted presses reach the game
How to reproduce: the builds from the same dump with nx2/make_game.py, the same options file and save, HOS_INPUT_EXCLUSIVE=1 HOS_INPUT_SCRIPT=12:A,15:A,...,42:A HOS_INPUT_SCRIPT_BACKGROUND=1 RX_VK_FRAME_LOG=<csv>

Before: main @ 1b2e7555 After: this PR @ d5b37c06
presents per second (run 1 / run 2) 60.00 / 59.97 60.00 / 60.00
median frame time (run 1 / run 2) 16.636 / 16.649 ms 16.645 / 16.655 ms
p99 frame time (run 1 / run 2) 18.350 / 18.181 ms 18.247 / 18.211 ms
the game's own rate 60.0 fps 60.0 fps
Longshot-base-run1: 5362 frames in 89.3 s after 60 s warm-up: 60.00 fps, median 16.636 ms, p99 18.350 ms, max 22.38 ms
Longshot-vr-run1:   5343 frames in 89.0 s after 60 s warm-up: 60.00 fps, median 16.645 ms, p99 18.247 ms, max 52.88 ms
Longshot-base-run2: 5361 frames in 89.4 s after 60 s warm-up: 59.97 fps, median 16.649 ms, p99 18.181 ms, max 77.60 ms
Longshot-vr-run2:   5347 frames in 89.1 s after 60 s warm-up: 60.00 fps, median 16.655 ms, p99 18.211 ms, max 22.71 ms
[hos Presentation Thread] vi: 11677 frames presented (60.0 fps over the last 5.0 s, interval 1)

Measured at d5b37c06 on main 1b2e7555. The head since is rebased onto main @ 615b2498, whose five new commits are for the Steam Deck's GPU clock, Intel GPUs' uniforms, speech bubbles at wide picture shapes, the build and Linux audio output (one conflict, in gpu/vk/vk_main.cpp: main's gpu_clock_device_created and this PR's xr_device_ready side by side; this PR's own lines are otherwise unchanged), and adds the run's file, docs/tested/2026-11-16-vr-openxr-airdamien-run03.md. The run on main 71b1edd8 (the same result) is docs/tested/2026-11-16-vr-openxr-airdamien-run02.md; the earlier runs, with VR on in a Meta Quest 3, are in docs/tested-configurations.md (2026-11-13).

Flags and settings

The VR tab's rows (kept in a new longshot_vr.ini), switches for one run and for tests, and a build variable for the loader.

Flag What it is Before this PR After this PR Effect Helps / doesn't help / untested Recommendation
longshot_vr.ini vr= / VR tab "VR headset" The game in an OpenXR headset No VR Off (no file: off) The renderer runs through OpenXR, after a restart Helps: Windows with a PC VR headset. Doesn't help: everyone else (nothing runs). Untested: headsets other than a Quest 3 over Link Off by default
stereo= / VR tab "View" Stereo 3D, or the flat screen No VR Flat screen The game's camera at your eyes, or a big screen Helps: a Quest 3 over Link, both views. Untested: SteamVR, Virtual Desktop, WMR Flat screen until more headsets are tested
VR tab: First person, World scale, Eye separation, Level horizon, Head movement, Fill the view, Upscaler in 3D, Desktop window, HUD panel and its size, Reticle at the aim, Touch controllers, Paired frames, Headset pacing, Camera smoothing Stereo's settings, applied at once No such rows As quest/longshot_vr.ini Each changes the headset's picture or its controls Helps: a Quest 3 over Link, as tuned there. Untested: other headsets As they are
RX_VR=0 / 1, RX_VR_STEREO=0 / 1 vr= and stereo= for one run No such switches Unset Overrides the ini for one run Helps: test runs. Doesn't help: play Unset: only for testing
LONGSHOT_OPENXR_LOADER=<dir> Build: the folder with Khronos' openxr_loader.dll, copied beside the game No such variable Unset (the Builder sets it to its openxr-loader tool) The game folder gets the loader Helps: Windows builds. Doesn't help: Linux builds (no loader there) As it is
RX_VR_TEST=1 Stereo's cameras without a headset, for screenshots of each eye No such switch Unset A pretended head turns the camera Helps: developing without a headset. Doesn't help: play Off: only for testing
HOS_HEADLESS, LONGSHOT_PREPARE_ONLY (main's, now also read by xr_wanted()) A run with no game window: headless, or the shader preparation after a build Read by the host and the build only Also read by the VR code: no headset session for such a run The preparation no longer opens a headset session (it died on exit with vr=1, 0xc0000409) Helps: builds and headless runs with vr=1. Doesn't help: play As they are
RX_VR_TRACE=1 Logs the HUD's draws once every 10 s No such switch Unset More log lines Helps: debugging the HUD panel. Doesn't help: play Off: only for debugging

Testing

Tested:

  • python -I -B tests/run_all.py on Windows 11 (llvm-mingw) at head bb774bb9: 585 passed, 20 failed. The same 20 fail on main @ 615b2498 on this PC (local tools and packages, line endings in a pipe, fixtures of main's that do not compile here), not this change.
  • Built whole with nx2/make_game.py at heads d5b37c06 (measured) and bb774bb9 (Windows 11, RTX 5080).
  • Linux (WSL, Ubuntu 24.04, clang), at 5c269eda: the game-free checks pass but for three that need local packages, and RX_VK_ONLY=1 nx2/build.py --standalone compiles and links longshot_vk.so.
  • In the game, no headset (RTX 5080, Windows 11): starts and plays on the desktop with vr=1 and no headset connected, and with RX_VR=0. The VR tab opens, a row's change applies and is written to longshot_vr.ini (xr: menu: fp_height=0.30), the options file is left alone. RX_VR_TEST=1: the game hands out a view per frame and each frame is matched to its eye, 76 s without a crash.
  • The loader's way in: tools.py install --only openxr-loader with an empty cache downloads Khronos' archive, checks it and unpacks openxr_loader.dll; a make_game.py build with LONGSHOT_OPENXR_LOADER set puts it beside longshot.exe, and its shader preparation ends normally with vr=1.
  • With a headset: Quest 3 over Quest Link (Meta's OpenXR runtime 1.208.0), RTX 5080, at 7b2120c7, played in stereo 3D by the author: it looks fine; Ultrawide menus' sides stay out of the headset's pictures; the session closes cleanly on exit (xr: the session and the instance closed). The author has played stereo since on local builds that carry this code with the controller and NFC pull requests' changes and work not in this PR. Before the port, on Hookshot v2.1.0, the flat screen, stereo, the HUD panel and reticle and the Touch controllers were played over several sessions.

Not tested:

  • The flat-screen view on this base in a headset: stereo was the view played; the flat screen was played on Hookshot v2.1.0.
  • Main's render thread (#588, on by Auto from 12 logical processors) with a headset on this branch: the branch was rebased onto it today, and nobody has played them together on it.
  • AMD and Intel GPUs, and any headset or runtime other than a Quest 3 over Link: none at hand.
  • Linux at run time: the VR code is stubs there, so the game should behave as main; only the build and the game-free checks ran.
  • Cutscenes, pre-rendered movies and most areas in stereo.

Must be tested:

  • Windows, AMD or Intel GPU, no headset: start the game and play a minute, open the Insert menu's VR tab, expecting the game to play as on main and the tab to show its rows (Test Farm: @Beanstalk windows amd, start the game with no headset, play a minute and open the Insert menu's VR tab)
  • Linux, any GPU: start the game and open the Insert menu's VR tab, expecting the game to play as on main and the tab to show one row saying VR is not in the Linux build (Test Farm: @Beanstalk linux, start the game and open the Insert menu's VR tab)
  • Windows, a SteamVR or Virtual Desktop headset: set VR headset On and View to each of Flat screen and Stereo 3D, restart, play a minute in each and quit, expecting the picture in the headset in both views and no crash on exit (by hand: a tester with such a headset; the Test Farm has none)

Screenshots

The Insert menu's VR tab, this PR @ 5c269eda (the tab is the same at the head; main has no such tab):

The VR tab's first rows

The VR tab further down: the 3D view's rows and the HUD's

Risks

What could break: with VR off (the default) the new code is a handful of calls that return at once; the measured cost at the cap is none. The host changes are in every build: realtime_step and the camera hook ask the renderer for a view each frame, and do nothing unless the renderer says a headset runs in stereo. The lifted projection patch (nx2/oot_wide.py) reads host globals that are zero without a headset. Known in stereo: an occasional repeated frame on fast turns; first person shows no body. tools.lock's new line needs mirroring before a release (Reviewer notes).

Turning it off: vr=0 in longshot_vr.ini, the VR tab's VR headset row, or RX_VR=0; otherwise revert the commits (nothing is migrated).

Compatibility: the game is lifted again (the projection patch), so the first start after updating translates and prepares as after any lift change. MkwVkHost and MkwVkRenderer are unchanged (MKWVK_API_VERSION as on main): the host finds the new calls as optional exports. Saves and longshot_options.ini are unchanged; the VR settings are in a new longshot_vr.ini. The Builder downloads one more tool (Khronos' loader, 32 MB).

Reviewer notes

  • This is large for one PR. If it is wanted in pieces, the natural split is: flat-screen mode (renderer only, no host or lift change), then stereo, then the menu tab.
  • Before this merges, a maintainer needs to mirror the loader: python -I scripts/tools.py mirror openxr-loader. tools.lock's new line names its copies in Longshot's store first, as tests/test_tools_lock.py asks, and they are not there yet. tools.py falls through to Khronos' URL (a fresh cache installs it), but the Windows setup (builder/setup/setup.c) reads only a line's first two URLs, so a Builder release cut from an unmirrored lock could not install; tools.py check --require refuses such a release. If a 32 MB download for every Builder install is not wanted for a feature that is off by default, say so and I will make it a build option instead (as --fetch-fsr-runtime is).
  • The work started on Hookshot before the move.

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what
    can't be run by hand is in Testing's Not testable by hand, with why.
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and
    in Risks.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported.
  • Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value.
  • Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen.
  • A file in docs/tested/ for each new measured run (format in docs/tested-configurations.md).
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • Docs updated.

🤖 Generated with Claude Code

**Type:** feat · **Risk:** high · **Tested on:** Windows 11, RTX 5080, Meta Quest 3 over Link · **Needs:** Windows with AMD or Intel, Linux, other headsets ## Why Longshot can only be played on a monitor. This lets it be played in a PC VR headset (tested with a Meta Quest 3 over Quest Link): either on a big flat screen in front of you, or in stereo 3D with the game's camera at your eyes. No issue in the tracker asks for it (searched: "VR", "headset", "OpenXR", "Quest"). ## What changed The renderer can run through OpenXR: with VR on, the game shows on a big screen in the headset, or in stereo 3D with one eye drawn a frame and the two eyes handed to the headset as a pair, the HUD on a panel in front of you and the Touch controllers as a gamepad. A VR tab in the Insert menu holds its settings (kept in `longshot_vr.ini`). With VR off, the default, nothing of it runs. - vr: `gpu/vk/vk_xr.cpp` / `vk_xr.h` (new). The renderer's instance and device are made through OpenXR (`XR_KHR_vulkan_enable2`) when VR is on. Flat-screen mode shows every presented picture on a quad layer. Stereo mode draws one eye a frame (`xr_view`), matches frames to eyes by the scene camera (`xr_note_scene_draw`), holds a pair's first eye until its second and gives both to the headset together (`xr_copy_acquire`, `publish_held`), one pair per `xrWaitFrame` (`xr_thread`). The HUD is redirected to a head-locked panel (`xr_hud_draw`), with its middle (the aiming reticle) shown where the game aims. A first-person view (left-stick tap or F9). The Touch controllers as a virtual SDL gamepad (`pad_attach`). On Linux the file is stubs (`xr_built()` false): it is Win32 only for now. - vr: no headset for a run with no game window (`--prepare-shaders`, `HOS_HEADLESS`): `xr_wanted()`. - vk: hooks in `vk_main.cpp` (instance, device, shutdown), `vk_replay.cpp` (`present_image`: the copies to the headset, the window's mirror), `vk_draw.cpp` (HUD and scene-camera notes), `vk_temporal.cpp` (a DLSS/FSR history per eye), `vk_framegen.cpp` (no made frames with a headset). - menu: a **VR** tab in `gpu/vk/vk_menu.cpp`. `Row::apply` is new: a row kept outside the options file (these are kept in `longshot_vr.ini`, written by `xr_opt_changed`). - runtime: `host/hos_main.c` `hos_oot_free_view` hands the game the headset's view and field of view; `host/nn_vi.c` `realtime_step` steps the game in pairs of frames while stereo runs (both eyes one moment); `host/rx_backend.c` looks up the renderer's optional `mkwvk_xr_*` exports. - lift: `nx2/oot_wide.py` (the projection's field of view at the five matrix-update sites), `nx2/oot_patches.py` (the step hook records the step a frame read). - build: `nx2/build.py` adds `third_party/openxr/include`, and copies Khronos' `openxr_loader.dll` beside the game when the tools have it (`LONGSHOT_OPENXR_LOADER`); `nx2/make_game.py` carries it into the game folder (`BESIDE`). `quest/build_vk.ps1` builds the renderer alone and installs it with the loader. - tools: `tools.lock` has a line for Khronos' loader (`openxr-loader`, Khronos' own release archive, Apache-2.0, SHA-256 pinned), so the Builder downloads it with its other tools; `builder/LongshotBuilder/Runner.cs` passes its folder to the build. Nothing of it is committed or packaged in a release. - third_party: `third_party/openxr` (Khronos' headers, Apache-2.0, unmodified, with `PROVENANCE.md`). - docs: `quest/README.md`, the README's VR rows, the switches in `docs/development.md`. - tests: stubs for the new calls in the fixtures that read the changed functions; `tests/test_readme_menu_rows.py` covers the VR tab. ## Measurements **Verdict:** no cost with VR off, the default: the frame times are main's within run-to-run noise (median 16.65-16.66 ms against 16.64-16.65 ms, the game at its 60 fps cap in every run). VR itself is measured in a headset only in the earlier runs below. Hardware: Windows 11, NVIDIA GeForce RTX 5080 16 GB (driver 591.59), Intel Core Ultra 9 285K, 32 GB Scene: Castle Town's gate by day from a test save, Link standing still; the defaults of a new game folder (2560x1440 output, DLSS, no frame generation, the game's frame rate cap 60, windowed, V-Sync off); VR off (`RX_VR=0`) Method: 150 s runs, the first 60 s left out, two runs each interleaved with main; `RX_VK_FRAME_LOG`'s frame times, a line per present; the game's own rate from the log's `vi:` line; `HOS_INPUT_EXCLUSIVE=1` so only the scripted presses reach the game How to reproduce: the builds from the same dump with `nx2/make_game.py`, the same options file and save, `HOS_INPUT_EXCLUSIVE=1 HOS_INPUT_SCRIPT=12:A,15:A,...,42:A HOS_INPUT_SCRIPT_BACKGROUND=1 RX_VK_FRAME_LOG=<csv>` | | Before: main @ 1b2e7555 | After: this PR @ d5b37c06 | |---|---|---| | presents per second (run 1 / run 2) | 60.00 / 59.97 | 60.00 / 60.00 | | median frame time (run 1 / run 2) | 16.636 / 16.649 ms | 16.645 / 16.655 ms | | p99 frame time (run 1 / run 2) | 18.350 / 18.181 ms | 18.247 / 18.211 ms | | the game's own rate | 60.0 fps | 60.0 fps | ``` Longshot-base-run1: 5362 frames in 89.3 s after 60 s warm-up: 60.00 fps, median 16.636 ms, p99 18.350 ms, max 22.38 ms Longshot-vr-run1: 5343 frames in 89.0 s after 60 s warm-up: 60.00 fps, median 16.645 ms, p99 18.247 ms, max 52.88 ms Longshot-base-run2: 5361 frames in 89.4 s after 60 s warm-up: 59.97 fps, median 16.649 ms, p99 18.181 ms, max 77.60 ms Longshot-vr-run2: 5347 frames in 89.1 s after 60 s warm-up: 60.00 fps, median 16.655 ms, p99 18.211 ms, max 22.71 ms [hos Presentation Thread] vi: 11677 frames presented (60.0 fps over the last 5.0 s, interval 1) ``` Measured at d5b37c06 on main 1b2e7555. The head since is rebased onto main @ 615b2498, whose five new commits are for the Steam Deck's GPU clock, Intel GPUs' uniforms, speech bubbles at wide picture shapes, the build and Linux audio output (one conflict, in `gpu/vk/vk_main.cpp`: main's `gpu_clock_device_created` and this PR's `xr_device_ready` side by side; this PR's own lines are otherwise unchanged), and adds the run's file, `docs/tested/2026-11-16-vr-openxr-airdamien-run03.md`. The run on main 71b1edd8 (the same result) is `docs/tested/2026-11-16-vr-openxr-airdamien-run02.md`; the earlier runs, with VR on in a Meta Quest 3, are in `docs/tested-configurations.md` (2026-11-13). ### Flags and settings The VR tab's rows (kept in a new `longshot_vr.ini`), switches for one run and for tests, and a build variable for the loader. | Flag | What it is | Before this PR | After this PR | Effect | Helps / doesn't help / untested | Recommendation | |---|---|---|---|---|---|---| | `longshot_vr.ini` `vr=` / VR tab "VR headset" | The game in an OpenXR headset | No VR | Off (no file: off) | The renderer runs through OpenXR, after a restart | Helps: Windows with a PC VR headset. Doesn't help: everyone else (nothing runs). Untested: headsets other than a Quest 3 over Link | Off by default | | `stereo=` / VR tab "View" | Stereo 3D, or the flat screen | No VR | Flat screen | The game's camera at your eyes, or a big screen | Helps: a Quest 3 over Link, both views. Untested: SteamVR, Virtual Desktop, WMR | Flat screen until more headsets are tested | | VR tab: First person, World scale, Eye separation, Level horizon, Head movement, Fill the view, Upscaler in 3D, Desktop window, HUD panel and its size, Reticle at the aim, Touch controllers, Paired frames, Headset pacing, Camera smoothing | Stereo's settings, applied at once | No such rows | As `quest/longshot_vr.ini` | Each changes the headset's picture or its controls | Helps: a Quest 3 over Link, as tuned there. Untested: other headsets | As they are | | `RX_VR=0` / `1`, `RX_VR_STEREO=0` / `1` | `vr=` and `stereo=` for one run | No such switches | Unset | Overrides the ini for one run | Helps: test runs. Doesn't help: play | Unset: only for testing | | `LONGSHOT_OPENXR_LOADER=<dir>` | Build: the folder with Khronos' `openxr_loader.dll`, copied beside the game | No such variable | Unset (the Builder sets it to its `openxr-loader` tool) | The game folder gets the loader | Helps: Windows builds. Doesn't help: Linux builds (no loader there) | As it is | | `RX_VR_TEST=1` | Stereo's cameras without a headset, for screenshots of each eye | No such switch | Unset | A pretended head turns the camera | Helps: developing without a headset. Doesn't help: play | Off: only for testing | | `HOS_HEADLESS`, `LONGSHOT_PREPARE_ONLY` (main's, now also read by `xr_wanted()`) | A run with no game window: headless, or the shader preparation after a build | Read by the host and the build only | Also read by the VR code: no headset session for such a run | The preparation no longer opens a headset session (it died on exit with `vr=1`, 0xc0000409) | Helps: builds and headless runs with `vr=1`. Doesn't help: play | As they are | | `RX_VR_TRACE=1` | Logs the HUD's draws once every 10 s | No such switch | Unset | More log lines | Helps: debugging the HUD panel. Doesn't help: play | Off: only for debugging | ## Testing **Tested:** - `python -I -B tests/run_all.py` on Windows 11 (llvm-mingw) at head bb774bb9: 585 passed, 20 failed. The same 20 fail on `main` @ 615b2498 on this PC (local tools and packages, line endings in a pipe, fixtures of main's that do not compile here), not this change. - Built whole with `nx2/make_game.py` at heads d5b37c06 (measured) and bb774bb9 (Windows 11, RTX 5080). - Linux (WSL, Ubuntu 24.04, clang), at 5c269eda: the game-free checks pass but for three that need local packages, and `RX_VK_ONLY=1 nx2/build.py --standalone` compiles and links `longshot_vk.so`. - In the game, no headset (RTX 5080, Windows 11): starts and plays on the desktop with `vr=1` and no headset connected, and with `RX_VR=0`. The VR tab opens, a row's change applies and is written to `longshot_vr.ini` (`xr: menu: fp_height=0.30`), the options file is left alone. `RX_VR_TEST=1`: the game hands out a view per frame and each frame is matched to its eye, 76 s without a crash. - The loader's way in: `tools.py install --only openxr-loader` with an empty cache downloads Khronos' archive, checks it and unpacks `openxr_loader.dll`; a `make_game.py` build with `LONGSHOT_OPENXR_LOADER` set puts it beside `longshot.exe`, and its shader preparation ends normally with `vr=1`. - With a headset: Quest 3 over Quest Link (Meta's OpenXR runtime 1.208.0), RTX 5080, at 7b2120c7, played in stereo 3D by the author: it looks fine; Ultrawide menus' sides stay out of the headset's pictures; the session closes cleanly on exit (`xr: the session and the instance closed`). The author has played stereo since on local builds that carry this code with the controller and NFC pull requests' changes and work not in this PR. Before the port, on Hookshot v2.1.0, the flat screen, stereo, the HUD panel and reticle and the Touch controllers were played over several sessions. **Not tested:** - The flat-screen view on this base in a headset: stereo was the view played; the flat screen was played on Hookshot v2.1.0. - Main's render thread (#588, on by Auto from 12 logical processors) with a headset on this branch: the branch was rebased onto it today, and nobody has played them together on it. - AMD and Intel GPUs, and any headset or runtime other than a Quest 3 over Link: none at hand. - Linux at run time: the VR code is stubs there, so the game should behave as `main`; only the build and the game-free checks ran. - Cutscenes, pre-rendered movies and most areas in stereo. **Must be tested:** - Windows, AMD or Intel GPU, no headset: start the game and play a minute, open the Insert menu's VR tab, expecting the game to play as on main and the tab to show its rows (Test Farm: @Beanstalk windows amd, start the game with no headset, play a minute and open the Insert menu's VR tab) - Linux, any GPU: start the game and open the Insert menu's VR tab, expecting the game to play as on main and the tab to show one row saying VR is not in the Linux build (Test Farm: @Beanstalk linux, start the game and open the Insert menu's VR tab) - Windows, a SteamVR or Virtual Desktop headset: set VR headset On and View to each of Flat screen and Stereo 3D, restart, play a minute in each and quit, expecting the picture in the headset in both views and no crash on exit (by hand: a tester with such a headset; the Test Farm has none) ## Screenshots The Insert menu's VR tab, this PR @ 5c269eda (the tab is the same at the head; `main` has no such tab): ![The VR tab's first rows](https://git.magicbean.dev/attachments/7fcd8013-e636-43f3-8421-98697303fe7a) ![The VR tab further down: the 3D view's rows and the HUD's](https://git.magicbean.dev/attachments/91a74e2b-5902-4fba-8865-4a61ee255995) ## Risks **What could break:** with VR off (the default) the new code is a handful of calls that return at once; the measured cost at the cap is none. The host changes are in every build: `realtime_step` and the camera hook ask the renderer for a view each frame, and do nothing unless the renderer says a headset runs in stereo. The lifted projection patch (`nx2/oot_wide.py`) reads host globals that are zero without a headset. Known in stereo: an occasional repeated frame on fast turns; first person shows no body. `tools.lock`'s new line needs mirroring before a release (Reviewer notes). **Turning it off:** `vr=0` in `longshot_vr.ini`, the VR tab's VR headset row, or `RX_VR=0`; otherwise revert the commits (nothing is migrated). **Compatibility:** the game is lifted again (the projection patch), so the first start after updating translates and prepares as after any lift change. `MkwVkHost` and `MkwVkRenderer` are unchanged (`MKWVK_API_VERSION` as on main): the host finds the new calls as optional exports. Saves and `longshot_options.ini` are unchanged; the VR settings are in a new `longshot_vr.ini`. The Builder downloads one more tool (Khronos' loader, 32 MB). ## Reviewer notes - This is large for one PR. If it is wanted in pieces, the natural split is: flat-screen mode (renderer only, no host or lift change), then stereo, then the menu tab. - **Before this merges, a maintainer needs to mirror the loader:** `python -I scripts/tools.py mirror openxr-loader`. `tools.lock`'s new line names its copies in Longshot's store first, as `tests/test_tools_lock.py` asks, and they are not there yet. `tools.py` falls through to Khronos' URL (a fresh cache installs it), but the Windows setup (`builder/setup/setup.c`) reads only a line's first two URLs, so a Builder release cut from an unmirrored lock could not install; `tools.py check --require` refuses such a release. If a 32 MB download for every Builder install is not wanted for a feature that is off by default, say so and I will make it a build option instead (as `--fetch-fsr-runtime` is). - The work started on Hookshot before the move. ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what can't be run by hand is in Testing's Not testable by hand, with why. - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and in Risks. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported. - [x] Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value. - [x] Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen. - [x] A file in `docs/tested/` for each new measured run (format in `docs/tested-configurations.md`). - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [x] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. - [x] Docs updated. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
First-time contributor

Rebased onto main @ 0c74253d and measured again there (VR off: 236.4 / 236.9 presents a second against main's 236.3 / 237.9, the same median frame time). Added: the Ultrawide menus fix found in a headset run (7b2120c7), the README's VR rows, two tested-configurations rows, and the three test requests (T-N5H4, T-VZY2, T-W3YQ). Still WIP: the head has not been run in a headset yet, and the screenshots are to attach.

Rebased onto main @ 0c74253d and measured again there (VR off: 236.4 / 236.9 presents a second against main's 236.3 / 237.9, the same median frame time). Added: the Ultrawide menus fix found in a headset run (7b2120c7), the README's VR rows, two tested-configurations rows, and the three test requests (T-N5H4, T-VZY2, T-W3YQ). Still WIP: the head has not been run in a headset yet, and the screenshots are to attach.
Author
First-time contributor

The README has a line for each VR row, and tests/test_readme_menu_rows.py now covers the VR tab (it failed on the grouped lines of the commit before). run_all on Windows: 443 passed, the 7 failures are main's on this PC.

The README has a line for each VR row, and tests/test_readme_menu_rows.py now covers the VR tab (it failed on the grouped lines of the commit before). run_all on Windows: 443 passed, the 7 failures are main's on this PC.
Author
First-time contributor

Run in the headset at the head's code (the build of 7b2120c7, Quest 3 over Link, stereo 3D, Ultrawide menus at Centred, blurred sides): it looks fine, the sides no longer reach the headset, and the session closes cleanly. Screenshots of the VR tab attached. Marking it ready.

Run in the headset at the head's code (the build of 7b2120c7, Quest 3 over Link, stereo 3D, Ultrawide menus at Centred, blurred sides): it looks fine, the sides no longer reach the headset, and the session closes cleanly. Screenshots of the VR tab attached. Marking it ready.
airdamien changed title from WIP: feat(vr): play in a PC VR headset over OpenXR, with a VR tab in the Insert menu to feat(vr): play in a PC VR headset over OpenXR, with a VR tab in the Insert menu 2026-11-13 14:45:10 +00:00
Author
First-time contributor

menu_0
menu_1

![menu_0](/attachments/47acd91a-08b8-48f4-8391-56640b8f3f56) ![menu_1](/attachments/405423b1-3b95-4992-8fd5-186e0767243a)
airdamien force-pushed feat/vr-openxr from 843ab23c10
All checks were successful
PR description / Description follows the template (pull_request_target) Successful in 3s
to 3f6d4ef86f
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 11s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
2026-11-13 14:57:24 +00:00
Compare
Author
First-time contributor

The loader no longer needs packaging or a script: tools.lock has a line for Khronos' release archive (openxr-loader), the Builder passes its folder to the build, and the build copies openxr_loader.dll beside the game. A maintainer needs to mirror it before a release (tools.py mirror openxr-loader): the reviewer notes say why. Also: a run with no game window (--prepare-shaders, HOS_HEADLESS) no longer opens a headset session; the preparation after a build died on exit with vr=1. Rebased onto main's head; run_all on Windows: 443 passed, the 7 failures are main's on this PC.

The loader no longer needs packaging or a script: tools.lock has a line for Khronos' release archive (openxr-loader), the Builder passes its folder to the build, and the build copies openxr_loader.dll beside the game. A maintainer needs to mirror it before a release (tools.py mirror openxr-loader): the reviewer notes say why. Also: a run with no game window (--prepare-shaders, HOS_HEADLESS) no longer opens a headset session; the preparation after a build died on exit with vr=1. Rebased onto main's head; run_all on Windows: 443 passed, the 7 failures are main's on this PC.
airdamien force-pushed feat/vr-openxr from 3f6d4ef86f
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 11s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
to 10d2a376c5
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 8s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-13 19:55:49 +00:00
Compare
Author
First-time contributor

Rebased onto main @ 514591a3 (head 10d2a376). One conflict, row_shown's line in the menu (main's Damage taken row beside the VR rows' condition); tests/test_damage_debug_menu.py, new on main, gets a stub for vr_row_shown. Built whole and the checks run (454 passed; the 7 that fail also fail on main here). Not measured again: the description says why.

Rebased onto main @ 514591a3 (head 10d2a376). One conflict, `row_shown`'s line in the menu (main's Damage taken row beside the VR rows' condition); `tests/test_damage_debug_menu.py`, new on main, gets a stub for `vr_row_shown`. Built whole and the checks run (454 passed; the 7 that fail also fail on main here). Not measured again: the description says why.
airdamien force-pushed feat/vr-openxr from 10d2a376c5
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 8s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to 40fae344ce
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 7s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-14 03:30:30 +00:00
Compare
Author
First-time contributor

Rebased onto main @ cf605c85 (head 40fae344). Conflicts: row_shown in the menu (main's Intel shader compiles row), the host's options (hold-to-toggle), and the measured runs, which are now two files under docs/tested/ as #96 asks. python -I -B tests/run_all.py: 477 passed; the 7 that fail also fail on main here. Built whole. Not measured again: the description says why.

Rebased onto main @ cf605c85 (head 40fae344). Conflicts: `row_shown` in the menu (main's Intel shader compiles row), the host's options (hold-to-toggle), and the measured runs, which are now two files under `docs/tested/` as #96 asks. `python -I -B tests/run_all.py`: 477 passed; the 7 that fail also fail on main here. Built whole. Not measured again: the description says why.
airdamien force-pushed feat/vr-openxr from 40fae344ce
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 7s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to 0d30abedef
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 14s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-14 05:37:27 +00:00
Compare
Owner

This conflicts with main (7bacf846) and needs a rebase by hand: gpu/vk/vk_menu.cpp (#729, #550, #735), gpu/vk/vk_replay.cpp (#769, #443), nx2/build.py (#577, #857), docs/development.md and tests/test_frame_rate_cap_step.py (#488). Please rebase onto current main.

This conflicts with `main` (7bacf846) and needs a rebase by hand: `gpu/vk/vk_menu.cpp` (https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/729, https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/550, https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/735), `gpu/vk/vk_replay.cpp` (https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/769, https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/443), `nx2/build.py` (https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/577, https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/857), `docs/development.md` and `tests/test_frame_rate_cap_step.py` (https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/488). Please rebase onto current `main`.
airdamien force-pushed feat/vr-openxr from 0d30abedef
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 14s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to 5595ad0a18
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 4s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-15 23:56:39 +00:00
Compare
Author
First-time contributor

Rebased onto main @ a8a30c22 (head 5595ad0a), as asked. Conflicts:

  • gpu/vk/vk_menu.cpp: the VR tab's helpers beside main's text fields (#51), and Recentre in main's new prompt layout.
  • gpu/vk/vk_replay.cpp: main's HOS_OPT_SKIP_TITLE and HOS_OPT_RENDER_THREAD answers kept; id == 4 still answers on while a headset runs.
  • gpu/vk/vk_temporal.cpp: xr_no_temporal() ahead of main's env_xess().
  • nx2/build.py: the OpenXR include beside main's tp_vflags (#629).
  • Main has dropped wgpu-native (#577), so this branch no longer brings any of it back (tools.lock, Runner.cs, make_game.py, CONTRIBUTING.md, docs/releases.md, docs/development.md): only the openxr-loader lines are added.
  • tests/test_frame_rate_cap_step.py and tests/upscale_independent_test.cpp: the stubs for rx_xr_sync and xr_enabled beside main's new ones (#488, #109).

Built whole. python -I -B tests/run_all.py: 579 passed, 25 failed; the same 25 fail on main @ a8a30c22 on this PC. Not measured again in the headset.

Rebased onto main @ a8a30c22 (head 5595ad0a), as asked. Conflicts: - `gpu/vk/vk_menu.cpp`: the VR tab's helpers beside main's text fields (#51), and Recentre in main's new prompt layout. - `gpu/vk/vk_replay.cpp`: main's `HOS_OPT_SKIP_TITLE` and `HOS_OPT_RENDER_THREAD` answers kept; `id == 4` still answers on while a headset runs. - `gpu/vk/vk_temporal.cpp`: `xr_no_temporal()` ahead of main's `env_xess()`. - `nx2/build.py`: the OpenXR include beside main's `tp_vflags` (#629). - Main has dropped wgpu-native (#577), so this branch no longer brings any of it back (`tools.lock`, `Runner.cs`, `make_game.py`, `CONTRIBUTING.md`, `docs/releases.md`, `docs/development.md`): only the `openxr-loader` lines are added. - `tests/test_frame_rate_cap_step.py` and `tests/upscale_independent_test.cpp`: the stubs for `rx_xr_sync` and `xr_enabled` beside main's new ones (#488, #109). Built whole. `python -I -B tests/run_all.py`: 579 passed, 25 failed; the same 25 fail on main @ a8a30c22 on this PC. Not measured again in the headset.
Author
First-time contributor

The description now follows main's new template (scripts/check_pr_description.py passes): the status line, a Verdict, the measurement columns by commit, the flags table's new columns, Must be tested with who runs each item, and Risks with Compatibility. Nothing in it is new but the latest rebase's test run and the items main's template asks for.

The description now follows main's new template (`scripts/check_pr_description.py` passes): the status line, a Verdict, the measurement columns by commit, the flags table's new columns, Must be tested with who runs each item, and Risks with Compatibility. Nothing in it is new but the latest rebase's test run and the items main's template asks for.
airdamien force-pushed feat/vr-openxr from 5595ad0a18
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 4s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to 0d6e78b088
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 7s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-16 09:46:11 +00:00
Compare
Author
First-time contributor

Rebased onto main @ a5b112b6. The pull requests that went in since conflicted with this branch:

  • #1001 (choosing the playback device) took MKWVK_API_VERSION 24. The controller pull request's rumble test is now 25 and the NFC pull request is 26. tests/test_audio_output_devices.py pinned the version at exactly 24 and required the playback callbacks to be the last host fields. It now checks for 24 or later, and for the callbacks right after options_path.
  • #998 (the FPS counter's details page) added a menu page. The NFC and VR tabs now sit beside it: 9 tab names in the settings bridge and 9 scroll slots.
  • #609 (the 30 FPS cap) changed host/nn_vi.c. Only VR touches this: any cap other than 60 takes the timed step, as on main, and so does a VR frame pair.

Built whole with nx2/make_game.py. tests/run_all.py fails the same 19 tests as main @ a5b112b6 on this PC. The description has the new heads.

Rebased onto main @ a5b112b6. The pull requests that went in since conflicted with this branch: - **#1001** (choosing the playback device) took `MKWVK_API_VERSION` 24. The controller pull request's rumble test is now 25 and the NFC pull request is 26. `tests/test_audio_output_devices.py` pinned the version at exactly 24 and required the playback callbacks to be the last host fields. It now checks for 24 or later, and for the callbacks right after `options_path`. - **#998** (the FPS counter's details page) added a menu page. The NFC and VR tabs now sit beside it: 9 tab names in the settings bridge and 9 scroll slots. - **#609** (the 30 FPS cap) changed `host/nn_vi.c`. Only VR touches this: any cap other than 60 takes the timed step, as on main, and so does a VR frame pair. Built whole with `nx2/make_game.py`. `tests/run_all.py` fails the same 19 tests as main @ a5b112b6 on this PC. The description has the new heads.
airdamien force-pushed feat/vr-openxr from 0d6e78b088
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 7s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to 7df4c09e3d
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 4s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-16 14:41:56 +00:00
Compare
Author
First-time contributor

Rebased onto main @ 71b1edd8 and measured again, interleaved with that main. The new run's file is under docs/tested/, and the description's Measurements section has the numbers. No cost in any run: the game held its 60 fps cap throughout, with median frame times within 0.03 ms of main's.

Since the last rebase, main took MKWVK_API_VERSION 25 for the microphone test (#1102), so the controller pull request's rumble test is now 26 and the NFC pull request is 27. tests/test_microphone_test_gain.py pinned the version at exactly 25; it now checks for 25 or later. In the VR pull request, the VR tab's check in the options file's loading loop now sits on a line of its own, because main's tests/test_framegen_by_row.py reads that loop's text.

Rebased onto main @ 71b1edd8 and measured again, interleaved with that main. The new run's file is under `docs/tested/`, and the description's Measurements section has the numbers. No cost in any run: the game held its 60 fps cap throughout, with median frame times within 0.03 ms of main's. Since the last rebase, main took `MKWVK_API_VERSION` 25 for the microphone test (#1102), so the controller pull request's rumble test is now 26 and the NFC pull request is 27. `tests/test_microphone_test_gain.py` pinned the version at exactly 25; it now checks for 25 or later. In the VR pull request, the VR tab's check in the options file's loading loop now sits on a line of its own, because main's `tests/test_framegen_by_row.py` reads that loop's text.
airdamien force-pushed feat/vr-openxr from 7df4c09e3d
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 4s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to 55e1ad8953
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 4s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-16 18:57:10 +00:00
Compare
Author
First-time contributor

Rebased onto main @ 1b2e7555 (eight perf(vk) and perf(lift) commits since 71b1edd8) with no conflicts, built whole, and measured again, interleaved with that main. The new run's file is under docs/tested/, and the description's Measurements section has the numbers. No cost: the game held its 60 fps cap in every run, with median frame times within 0.02 ms of main's. tests/run_all.py fails the same 21 tests as that main on this PC.

Rebased onto main @ 1b2e7555 (eight `perf(vk)` and `perf(lift)` commits since 71b1edd8) with no conflicts, built whole, and measured again, interleaved with that main. The new run's file is under `docs/tested/`, and the description's Measurements section has the numbers. No cost: the game held its 60 fps cap in every run, with median frame times within 0.02 ms of main's. `tests/run_all.py` fails the same 21 tests as that main on this PC.
Author
First-time contributor

Main moved again right after that push (615b2498, five commits), with one conflict in gpu/vk/vk_main.cpp: main's new gpu_clock_device_created call and this PR's xr_device_ready now sit side by side. Rebased onto it; this PR's own changed lines are identical to before. Built whole at bb774bb9, and tests/run_all.py fails the same 20 tests as that main on this PC. The measurement stays the one on 1b2e7555 from an hour earlier: none of the five commits touch the Windows NVIDIA path it measured.

Main moved again right after that push (615b2498, five commits), with one conflict in `gpu/vk/vk_main.cpp`: main's new `gpu_clock_device_created` call and this PR's `xr_device_ready` now sit side by side. Rebased onto it; this PR's own changed lines are identical to before. Built whole at bb774bb9, and `tests/run_all.py` fails the same 20 tests as that main on this PC. The measurement stays the one on 1b2e7555 from an hour earlier: none of the five commits touch the Windows NVIDIA path it measured.
airdamien force-pushed feat/vr-openxr from 55e1ad8953
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 4s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to bb774bb9b7
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 6s
2026-11-16 19:04:17 +00:00
Compare
Owner

Brought up to the ready-for-review standard (#1454): the checklist's Everyone list has two new boxes, added here from what this PR's description and comments show (please check they match what you know).

  • Tested on my own PC: ticked: Testing's Tested: the author's in-game run on Windows 11, RTX 5080, with no headset, and Quest 3 stereo play by the author.
  • Nothing gets worse that I know of: ticked: Measurements gives a no-cost verdict with frame-time numbers, and the stereo repeated-frame issue is stated in Risks.
Brought up to the [ready-for-review standard](https://git.magicbean.dev/MagicBeanDev/Longshot/src/branch/main/CONTRIBUTING.md#ready-for-review-out-of-wip) (#1454): the checklist's Everyone list has two new boxes, added here from what this PR's description and comments show (please check they match what you know). - *Tested on my own PC*: ticked: Testing's Tested: the author's in-game run on Windows 11, RTX 5080, with no headset, and Quest 3 stereo play by the author. - *Nothing gets worse that I know of*: ticked: Measurements gives a no-cost verdict with frame-time numbers, and the stereo repeated-frame issue is stated in Risks.
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 6s
This pull request has changes conflicting with the target branch.
  • README.md
  • gpu/vk/vk_menu.cpp
Some workflows are waiting to be reviewed.
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'feat/vr-openxr:airdamien-feat/vr-openxr'
git switch 'airdamien-feat/vr-openxr'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!204
No description provided.