Repository navigation
Refactor 6/6: XR input, Vulkan helpers and the video player - #101
Merged
Merged
Conversation
|
LGTM 👍 The refactor preserves the order-sensitive behavior: XR input still uses the predicted display time, |
seaweeduk
force-pushed
the
refactor/wave-4
branch
from
November 22, 2026 20:14
d34f623 to
7e05671
Compare
seaweeduk
force-pushed
the
refactor/wave-5
branch
from
November 22, 2026 20:14
0f8f487 to
53e2f9e
Compare
seaweeduk
force-pushed
the
refactor/wave-4
branch
from
November 22, 2026 20:59
7e05671 to
3880f06
Compare
seaweeduk
force-pushed
the
refactor/wave-5
branch
from
November 22, 2026 20:59
53e2f9e to
e635c6a
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.
Last layer of the structural refactor: XR input and device creation leave
XrContext, the Vulkan code loses its copies, the frame's two GPU participants share one protocol, the platform is decided once,VideoPlayer's event loop is split, and the background decoders share their helpers. Nothing changes for users.Steps in this layer: V1, V2, V3, V4, V5, V6, plus their review fixes.
V1:
XrContexthousekeeping. Controller, haptics and gaze input becomeXrInput, whichXrContextowns and destroys at the same point as before (before the session and instance). Callers usexr.input(). The 334-line Vulkan device creation becomes a builder in six steps, inxr_device.cpp; every extension, feature struct and pNext link is unchanged.V2: one copy of each Vulkan helper. The five single-attachment offscreen passes, their framebuffers and the full-screen pipeline come from
offscreen_pass. The three DMA-BUF importers share one image helper and one import helper. Each caller's formats, layouts, stages, access masks, usage bits and modifiers are passed in unchanged.V3: frame participants.
GlInteropandDirectVideoimplementFrameParticipant, andSceneRenderermakes their per-frame calls,GlInteropfirst, as before.V4: the platform decided once. Five
hwdec == "v4l2m2m"string compares inmain.cppbecome named facts in onePlatformPolicy, computed at start-up:directVideo,egl,pipelineByDefault,followVisibilityandearlyRender.V5:
VideoPlayer.pollEventshands each mpv event to its own handler (400 lines down to 59). The seek queue becomesSeekQueueand the video's sleep and resumePlayerSleep. The mpv session handshake and the Frame's early-render order don't move.V6: shared helpers for background media work. One
Interrupt, one FFmpeg open-and-decode sequence (media_decode), one background thread priority helper (thread_priority), and onevrcmdpath. The depth estimator's GL drawing becomes a second patch drawer besideDirectDepth. Each caller keeps its own decoder settings, read limits, interrupt timeout and thread priority.Review fixes.
XrInputcan't be copied, and onlyXrContextcreates, syncs and destroys it. The key picker and mask probe release a drawer's values. A rendered frame is checked for a resume only while one is under way. The key colour is packed only for the Frame's drawer.xr_context.cpplinesVideoPlayer::pollEventslinesVideoPlayerdata membersDepthEstimator::requestlinesAcross the whole stack:
main.cpplinesMenudata membersKnown and left as is
PlayerSleepowns the sleep and resume state.VideoPlayer::setPresentationActive()still decides when to close or reopen the track because it checks player readiness and decoder release.Important
AI disclosure
anthropic/claude-opus-5-5highopenai/gpt-6.2-astrahighAgent harness OpenCode 2.3.2