Skip to content

fix(weave/android): the overlay is per submit, and an unreadable one refuses (XR_DXR_weave v18) - #1835

Merged
dfattal merged 1 commit into
mainfrom
fix/android-weave-overlay-per-submit
Oct 7, 2026
Merged

dfattal merged 1 commit into
mainfrom
fix/android-weave-overlay-per-submit

Conversation

@dfattal

@dfattal dfattal commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Two gaps in the Android weave engine's v4 overlay handling, found while porting the browser's whole-page overlay to Android (DisplayXR/displayxr-browser-pvt#226):

  • A cached overlay was a standing overlay. The import is cached by AHardwareBuffer identity, and overlay_image was composited on every later submit, whether or not it chained an overlay. The whole-page overlay switches itself off while the page scrolls, so on those frames the last page it sent would land over a page that has moved. Now the overlay is composited only on a submit that chains one (overlay_this_submit); the import cache is kept.
  • An overlay that couldn't be imported was dropped and the frame woven anyway. The submit is now refused before anything is recorded, leaving the woven output untouched. Same rule as desktop Linux v16 (fix(weave/linux): an overlay that cannot be imported refuses the submit (XR_DXR_weave v16) #1825) and the D3D11 service.

XR_DXR_weave SPEC_VERSION 17, no new structure: the Android gate for callers whose overlay is their whole 2D, the same role v16 plays on desktop Linux. Header text and spec doc (§5d + the version table) updated. macOS still drops an unreadable overlay.

Compatibility

For callers whose overlay is decoration over content they present anyway (browser 0099 over-plane mode), the only change is on a frame that chains no overlay: it no longer shows the previous frame's overlay.

Overlap

feat/android-overlay-2d-dp (the DP-side overlay offer, 2D under the lens) touches the same block. Once both land, its set_overlay_2d offer must also require overlay_this_submit.

Test plan

  • CI build-android compiles it
  • NP02J: browser with --inline-3d-dp-overlay-page (browser-pvt PR to follow) on a page with text around a tile. Scroll, then stop: no stale page during the scroll.
  • NP02J: 0099 over-plane mode (--inline-3d-dp-overlay) unchanged

Not tested: nothing has run on hardware yet; the NP02J is currently disconnected.

🤖 Generated with Claude Code

…refuses (XR_DXR_weave v18)

Two gaps in the Android weave engine's v4 overlay handling, found while
porting the browser's whole-page overlay (browser-pvt#226) to Android:

1. A cached overlay was a STANDING overlay. The engine caches the overlay
   import by AHardwareBuffer identity (the caller re-sends the same buffer
   every frame), and composited mc->weave.overlay_image whenever it was set
   - so after one submit that chained an overlay, every later submit was
   composited with it, chained or not. The browser's whole-page overlay
   switches itself off while the page scrolls (its 0351 safety floor); on
   those frames the last page it sent would be composited over a page that
   has moved. The import is still cached (no re-import for the same
   buffer), but the overlay is now composited only on a submit that chains
   one (mc->weave.overlay_this_submit).

2. An overlay that could not be imported was DROPPED and the frame woven
   anyway, returning success. A caller that hands its whole 2D over as the
   overlay reads "accepted with the overlay chained" as "composited" and
   presents the woven output as the complete frame. The submit is now
   refused (XRT_ERROR_WEAVE_REFUSED -> XR_ERROR_RUNTIME_FAILURE) before
   anything is recorded, so the woven output is left exactly as the
   previous accepted submit left it: the desktop-Linux v16 rule (#1825) and
   the D3D11 service's. One WARN on the first refusal, then 1 in 300.

XR_DXR_weave SPEC_VERSION 18: no new structure, the Android gate for the
one kind of caller that needs it (overlay == its 2D), exactly as v16 is on
desktop Linux. The macOS engine still drops an unreadable overlay.

Callers whose overlay decorates content they present anyway (0099's
over-plane mode) see no difference except on a frame that chains no
overlay, which no longer shows the previous frame's.

Not tested on hardware: the NP02J is off the bus right now. Compiled by CI
(build-android). The branch feat/android-overlay-2d-dp (DP-side overlay
offer) touches the same block; its offer must also require
overlay_this_submit once both land.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Renumbered v17 -> v18 on rebase: main took v17 for the desktop-Linux stale-size
overlay rule (#1837).
@dfattal
dfattal force-pushed the fix/android-weave-overlay-per-submit branch from 875b383 to 97f9ac9 Compare October 7, 2026 07:33
@dfattal dfattal changed the title fix(weave/android): the overlay is per submit, and an unreadable one refuses (XR_DXR_weave v17) fix(weave/android): the overlay is per submit, and an unreadable one refuses (XR_DXR_weave v18) Oct 7, 2026
@dfattal

dfattal commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator Author

Rebased onto main. #1837 took XR_DXR_weave v17 for the desktop-Linux stale-size overlay rule, so this is now v18: header, spec doc (§5d + version table) and code comments. No functional change.

@dfattal
dfattal merged commit 7f05ca9 into main Oct 7, 2026
40 checks passed
@dfattal
dfattal deleted the fix/android-weave-overlay-per-submit branch October 7, 2026 07:45
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