Repository navigation
test_apps(cube_handle_metal_macos): adopt the depth cursor through dxr::CursorDepth (needs displayxr-common tag) - #1943
Merged
Merged
Conversation
…r::CursorDepth The reference adoption of XR_DXR_cursor_depth moves from hand-written code onto displayxr-common's dxr::CursorDepth helper: the app keeps only its cube ray test (RayHitCube) and its env knobs; pointer -> canvas UV, the footprint rays through the previous locate's views, the nearest hit, the struct chain and the OS-cursor hide/show are the helper's. The hand-written ViewRayDir / CursorFootprintHit and the per-frame chaining + NSCursor bookkeeping are gone (main.mm: +60 / -173). The runtime-drawn default look now samples the ARROW footprint (tip + ring around the arrow body, the runtime / web SDK rule) instead of a ring around the hotspot; the custom ring sprite and the app-drawn crosshair keep the centred footprint. Needs a displayxr-common tag carrying common/cursor_depth.h; the FetchContent pin (v2.27.0) does not have it yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dfattal
marked this pull request as ready for review
October 11, 2026 09:08
dfattal
added a commit
that referenced
this pull request
Oct 11, 2026
main moved test_apps/common to v2.29.0 (dxr::CursorDepth, #1943) while this branch was open; v2.29.0 is v2.28.0 (dxr::VkFrameRing) plus that one additive helper. Keep every test app on the same tag rather than leave the standalone-fetching apps one tag behind. This also gives cube_handle_metal_macos the cursor_depth.h it already includes (main pins it at v2.27.0, which has no such header). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This was referenced Oct 11, 2026
dfattal
added a commit
that referenced
this pull request
Oct 11, 2026
…46 Amendment 2 §B) (#1946) * feat(cursor): the runtime draws the depth cursor on Vulkan and GL (ADR-046 Amendment 2 B) XR_DXR_cursor_depth v5 on the in-process vk_native and GL compositors; no new structs, no spec bump. - Shared default look: the Metal compositor's OS-cursor mirror moved to compositor/util/comp_cursor_look (+ _macos.m), a small lib Metal, vk_native and GL link. Mirrored [NSCursor currentCursor] on the main thread on macOS, else the last snapshot, else the procedural arrow; DXR_CURSOR_DEFAULT_LOOK=arrow forces it. Other platforms: the arrow. - vk_native: request consumed by the next commit, resolved to per-view tile corners; a cursor frame never zero-copies and always takes the renderer's compose pass, where the cursor is the last draw (QUAD vertex path, affine MVP, scissored per tile) into the private _SRGB target, published by the pass's raw copy - linear blend, sprite sampled through the single compose_source_view(), atlas stays ENCODED. Drawn under window-space layers (stamped later, at weave time) - documented. - GL: drawn after the window-space layers into whatever the atlas pass paints (compose target or encoded atlas), source bound through gl_bind_layer_source(); a cursor frame counts as a sub-rect layer in the fast-path predicate; GL sprites are sampled bottom-up. - State tracker: additive is_vk_native / is_gl_native arms in oxr_session_cursor_draw_supported/_hand_request. - ADR-046 "B as built on Vulkan and GL", spec backends note, DXR_* census. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(test_apps): cube_handle_vk/gl_macos adopt the runtime-drawn cursor via dxr::CursorDepth (XR_DXR_cursor_depth v5) Same adoption as cube_handle_metal_macos (#1943): the app keeps only its cube ray test (RayHitCube) and env knobs; pointer UV, footprint rays, the struct chains and OS-cursor hide/show are displayxr-common's dxr::CursorDepth (v2.29.0, the aggregate test_apps pin). DISPLAYXR_CURSOR_DEPTH_DRAW=runtime (default) | app, DISPLAYXR_CURSOR_DEPTH_SPRITE=custom (64x64 cyan ring sprite swapchain; GL uploads it bottom row first), DISPLAYXR_CURSOR_DEPTH_UV, DISPLAYXR_CURSOR_DEPTH=0 opt-out. The GL cube had no cursor-depth code: it gains RayHitCube, the helper, and an app-mode crosshair. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test_apps: GL cube depth cursor opt-in (#1947); displayxr-common v2.29.0 standalone pins - cube_handle_gl_macos: XR_DXR_cursor_depth is now OPT-IN (DISPLAYXR_CURSOR_DEPTH=1). With the OS cursor hidden the GL cube crashes ~1 in 5 launches in Apple's GL driver (GL compositor repaint thread vs AppKit, runtime#1947). Metal and Vulkan cubes stay default-on. - cube_handle_{metal,vk,gl}_macos: standalone FetchContent pin of displayxr-common -> v2.29.0 (dxr::CursorDepth), matching the aggregate test_apps pin; each app builds standalone. - ADR-046: link runtime#1947 and runtime#1948. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
dfattal
added a commit
that referenced
this pull request
Oct 11, 2026
main moved test_apps/common to v2.29.0 (dxr::CursorDepth, #1943) while this branch was open; v2.29.0 is v2.28.0 (dxr::VkFrameRing) plus that one additive helper. Keep every test app on the same tag rather than leave the standalone-fetching apps one tag behind. This also gives cube_handle_metal_macos the cursor_depth.h it already includes (main pins it at v2.27.0, which has no such header). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
dfattal
added a commit
that referenced
this pull request
Oct 11, 2026
main moved test_apps/common to v2.29.0 (dxr::CursorDepth, #1943) while this branch was open; v2.29.0 is v2.28.0 (dxr::VkFrameRing) plus that one additive helper. Keep every test app on the same tag rather than leave the standalone-fetching apps one tag behind. This also gives cube_handle_metal_macos the cursor_depth.h it already includes (main pins it at v2.27.0, which has no such header). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
dfattal
added a commit
that referenced
this pull request
Oct 11, 2026
main moved test_apps/common to v2.29.0 (dxr::CursorDepth, #1943) while this branch was open; v2.29.0 is v2.28.0 (dxr::VkFrameRing) plus that one additive helper. Keep every test app on the same tag rather than leave the standalone-fetching apps one tag behind. This also gives cube_handle_metal_macos the cursor_depth.h it already includes (main pins it at v2.27.0, which has no such header). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
What
This moves the reference adoption of
XR_DXR_cursor_depth(ADR-046 Amendment 2) incube_handle_metal_macosfrom hand-written code onto displayxr-common'sdxr::CursorDepth.The app keeps:
RayHitCube, wired viasetRayCast);DISPLAYXR_CURSOR_DEPTH,_SOURCE,_ANCHOR,_DRAW,_SPRITE,_UV);The helper now does:
xrLocateViewschains;NSCursorhide/show.main.mmchanges by +60 / −173. The cursor adoption is now about 20 lines of setup (most of them map the env knobs), 1 line before the locate and 1 after it, plus the diagnostics logs that were already there.One intended behaviour difference: the runtime-drawn default look now samples the arrow footprint (the tip plus a ring around the arrow body), which is the runtime / web SDK rule. Before, it sampled a ring around the hotspot. The custom ring sprite and the app-drawn crosshair keep the centred footprint.
Evidence
I built against the displayxr-common branch with
-DFETCHCONTENT_SOURCE_DIR_DISPLAYXR_COMMON=<checkout>on thetest_apps/buildcache, ran./scripts/build_macos.sh, then ran the app headless withSIM_DISPLAY_OUTPUT=sbsand read the/tmp/dxr_atlas.pngcaptures. The baseline is the same app built frommain'smain.mmon the same box.main)willDraw=FALSEDISPLAYXR_CURSOR_DEPTH_DRAW=appDISPLAYXR_CURSOR_DEPTH_SPRITE=customwillDraw=TRUEDISPLAYXR_CURSOR_DEPTH=0The ±3 px spread is the cube's spin at capture time. It shows up in both builds.
Not tested
NSCursorhide/unhide on a panel. Only the scriptedDISPLAYXR_CURSOR_DEPTH_UVpath was run.DISPLAYXR_CURSOR_DEPTH_SOURCE=layerandDISPLAYXR_CURSOR_DEPTH_ANCHOR=…were not re-run. They map ontouseDepthLayer()/setAnchor(), which the displayxr-common unit tests cover.🤖 Generated with Claude Code