Skip to content

feat(cursor_depth): useMeasuredDisparity() — runtime-measured stereo source (XR_DXR_cursor_depth v7) - #77

Merged
dfattal merged 1 commit into
mainfrom
feat/cursor-depth-measured-disparity
Oct 12, 2026
Merged

dfattal merged 1 commit into
mainfrom
feat/cursor-depth-measured-disparity

Conversation

@dfattal

@dfattal dfattal commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Adds dxr::CursorDepth::useMeasuredDisparity(bool) for stereo content with no depth (SBS video, stereo photos, camera pairs). Runtime side: ADR-046 Amendment 3, XR_DXR_cursor_depth spec v7, displayxr-runtime#1976.

What

  • useMeasuredDisparity(true): on a runtime that reports spec v7 or later, the hint carries XrCursorDepthSourceDXR{source = MEASURED_DISPARITY (2)}. No app hit test runs and no point is sent. The runtime block-matches the outer submitted views.
  • Below v7 the request is not sent. The ray cast or hit test, if one is set, is the fallback.
  • useDepthLayer() and useMeasuredDisparity() now pick one runtime source, and the last call wins. Turning off the source that is not selected does nothing. useDepthLayer behaves as before.
  • The source kind is written as the value (XrCursorDepthSourceKindDXR)2, with a static_assert against the enum when the header is v7+. A consumer whose vendored header is v5 or v6 therefore still compiles.
  • The displayxr_extensions_headers pin moves to displayxr-extensions@722b47b (runtime 1d7fd8b2a, cursor_depth spec 7).
  • README: one paragraph in the depth-cursor section.

Zero cost holds: the request is per frame and only chained while the pointer is over the canvas. Turning it off stops all runtime cost from the next frame.

Evidence

  • displayxr_cursor_depth_test gets a new testMeasuredDisparity(). It covers v7 chaining kind 2 with no ray cast, an off-canvas pointer chaining nothing, toggling off to bring back the ray cast, v6 not sending the request, and the last-call-wins / no-op-off cases between the two sources. Full ctest: 7/7 pass on macOS (arm64).
  • Mutation check: two mutants were run. Gating at >= 6 fails "v6: no measured request". Sending SUBMITTED_DEPTH instead of MEASURED fails 3 checks. Both are caught.

NOT tested

Release

Following this repo's practice, this needs a tag after merge, v2.31.0 (minor: new API). The media-player PR currently pins this branch's commit SHA and needs a repin to the tag.

🤖 Generated with Claude Code

…reo source (XR_DXR_cursor_depth v7, ADR-046 Amendment 3)

CursorDepth::useMeasuredDisparity(bool) chains XrCursorDepthSourceDXR with
XR_CURSOR_DEPTH_SOURCE_MEASURED_DISPARITY_DXR (2) on runtimes reporting spec
v7+: no app hit test, no point; the runtime block-matches the submitted outer
views. Below v7 it is not sent and the ray cast / hit test is the fallback.
useDepthLayer() and useMeasuredDisparity() select one runtime source (last
call wins). Extension-header pin bumped to displayxr-extensions@722b47b
(cursor_depth spec 7). Contract test covers v7/v6/off-canvas/toggle-off and
was mutation-checked (spec gate and source kind).

Runtime: displayxr-runtime#1976.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dfattal
dfattal merged commit 16fe102 into main Oct 12, 2026
6 checks passed
@dfattal
dfattal deleted the feat/cursor-depth-measured-disparity branch October 12, 2026 17:34
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