Repository navigation
libretro: follow the headset through the unified VR view API - #23
Merged
Merged
Conversation
Taken whole from RetroArch's unified OpenXR pull request (libretro/RetroArch#19811). REQUEST_FLAT and ipd_hint_m are gone from retro_video_views; a map with RETRO_VIDEO_VIEWS_FLAG_TRACKED is the head-tracked view, and RETRO_VIDEO_VIEWS_STATUS_HMD is how a core learns of a headset. Co-authored-by: Craig <1188869+cscd98@users.noreply.github.com>
A core learns about a headset only from the HMD status bit, and the recommended eye size is only filled in while that bit is set, so the load-time negotiation never entered VR. The core now asks for the status every frame, enters VR on the first frame with HMD, sends a TRACKED map at the frontend's recommended eye size, and goes flat with an empty map. Entering sets the engine's screen to one eye and reports the 2x-wide frame with SET_SYSTEM_AV_INFO, which reinits video and runs context_reset; leaving restores the flat size the same way. A new eye size, flagged by TARGET_RESIZED or written back by the map, does the same, and the eye targets are rebuilt at the next bind. SET_PIXEL_FORMAT is only legal at load, so VR no longer switches HDR off. It needs Color Format 24-bit (Standard), and says so once when a headset is present on any other format. A video reinit restarts the headset session. A lost headset is waited for five seconds, repeating the last frame, before the core goes flat. Supersampling is ignored while VR is active instead of being turned off, so entering VR no longer rewrites the doom_hdr_ssaa option, and leaving it restores the choice. Co-authored-by: Craig <1188869+cscd98@users.noreply.github.com>
Davey-Hughes
force-pushed
the
unified-vr
branch
from
October 12, 2026 12:53
da2abb4 to
0275765
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the VR mode from #22 onto the unified VR view API in libretro/RetroArch#19811 (one OpenXR core for the desktop and Quest headsets, with head tracking).
It needs that pull request's
libretro.h, so it should merge after it.Against that RetroArch the current VR mode never starts. It negotiates once in
retro_load_game()and waits for a recommended eye size, which the frontend only fills in while a headset session is running. Its map also lacksRETRO_VIDEO_VIEWS_FLAG_TRACKED, so it would show as a flat stereo screen.What changes:
GET_VIDEO_VIEWS_STATUSevery frame, enters VR on the first frame withRETRO_VIDEO_VIEWS_STATUS_HMD, sends aTRACKEDmap at the recommended eye size, and goes flat with an empty map.SET_SYSTEM_AV_INFO. Leaving restores the flat size. A new eye size, flagged byTARGET_RESIZEDor written back by the map, is followed, and the eye targets are rebuilt.SET_PIXEL_FORMATis only legal at load, so VR no longer switches HDR off at run time. On another format the core says so once when a headset is present.doom_hdr_ssaakeeps the user's choice.Commits:
To try it:
HAVE_VR=1../configure --enable-openxron Linux, or the Quest build), with an OpenGL video driver. glcore is the one tested here.boom3_vr_enable=enabled.Tested on Linux, against a build of that pull request:
make -C neo HAVE_VR=1builds at each commit.libretro.cppalso compiles withoutHAVE_VR.@cscd98 tested this branch on a Quest, and it works there.
Known, and not addressed here: