Repository navigation
video_thread: the headset calls reach the driver under threaded video - #19736
Open
Davey-Hughes wants to merge 1 commit into
Open
Davey-Hughes wants to merge 1 commit into
Davey-Hughes wants to merge 1 commit into
Conversation
The wrapper's tables left the headset refresh query and the three VR calls empty. With Threaded Video on, the menu offered fallback rates, the headset was never asked for its rate, and on the Quest a VR core saw no headset, had its stereo map refused and got no poses. The refresh and the views status are answered on the caller's thread: the drivers read only what the headset thread publishes and what init and free change. The stereo request and the poses run on the video thread, as do the Quest context's sample, reference-space change and stereo flag, after the frames already queued: the frame locates its views in that space and is submitted with the poses it was drawn with, so tracked content runs in step with the video thread. Headset pacing stays off under threaded video, as before: the tick wait is in the driver's frame, which does not hold the core there.
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.
Description
With Threaded Video on, the frontend talks to the thread wrapper, whose tables left the newer VR hooks empty:
get_headset_refresh, poke)get_vr_frame_state)set_vr_content_info)get_video_views_status)So under threaded video the menu offered the fallback headset rates, and the runloop never learned the headset's rate (desktop, seen on a Steam Frame). On the Quest a VR core saw no headset, had its stereo map refused and got no poses, so it fell back to flat.
These calls come from the main thread while the driver runs on the video thread, so each forward has to be safe there:
video_thread_run_blocking(): the request sets the driver's stereo state, and taking the poses marks them for the frame that submits them.video_driver.c(the per-frame pose sample, frame flags, reference-space change, eye size, the GL stereo flag) also run on the video thread, after the frames already queued. The reference space used to be replaced from the main thread while the video thread located views and submitted layers in it. Waiting for the queue also means each frame is submitted with the poses it was drawn with. The cost is that head-tracked content runs in step with the video thread.driver_adjust_system_rates().Threaded video off: unchanged.
A new lane in
samples/gfx/threaded_video(lane_headset_calls) checks the forwards: the menu's rate list, the runloop's rate, the status, the stereo request and the poses, and that the request and poses run on the video thread. It also checks that a fitting headset rate does not pace threaded video. It fails six ways on master.Tested locally on Linux:
--enable-openxrcheck-vulkanwith--enable-openxron RADV under the validation layerC89_BUILD=1on the touched objects, plus a strict-std=c89build withHAVE_OPENXRdefinedHAVE_OPENXR=1, arm64)The Quest path is compile-checked only; it still needs a device test.
Related Issues
None filed.
Related Pull Requests
#19726 (Quest OpenXR) and #19729 (desktop headset output) added the hooks this forwards.