Repository navigation
feat(weave): a present-owner's element on screen 2 gets screen 2's views; cheap split signal - #1927
Merged
Merged
Conversation
…ews; cheap split signal ADR-047 Amendment 4 addendum, the runtime half of displayxr-browser-pvt#272. - A zone-scoped xrLocateViews (XR_DXR_view_rig + XrDisplayZoneDXR) of a present-owner whose window is woven per screen is framed server-side from the screen holding the WHOLE element when that is a non-primary screen: its eyes (predicted at the locate from its segment DP), its nominal viewer, and the element placed on its physical rectangle. A straddling element keeps the primary's views (per-part views need a web API, browser-pvt#272); an element on the primary and every window on one screen are framed exactly as before. - The table follows the window, not the session: the browser locates from its browser process and weaves from its GPU process, so the lookup (comp_d3d11_service_get_zone_weave_screen) takes the locating client's own fresh weave table, else that of any present-owner weaving the same HWND. clients_mutex only; render_mutex just for a re-framed element. - weave_submit's reply gains a trailing segment_count; the state tracker fetches weave_get_segments for a chained XrWeaveOutputRectPartsDXR only when it is non-zero, so a window on one screen costs a v19 caller no extra round trip. - Pure helpers in u_weave_rect_parts.h (u_weave_zone_screen_segment, u_weave_segment_window_metrics, u_weave_segments_fetch_needed), unit- tested in tests_weave_segments; proto test pins the trailing field. Refs DisplayXR/displayxr-browser-pvt#272 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dfattal
force-pushed
the
feat/present-owner-per-screen-views
branch
from
October 11, 2026 06:24
8ccd33d to
8d78c76
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.
Refs DisplayXR/displayxr-browser-pvt#272
What
This is the runtime follow-up to #1913 for the browser's multi-screen look-around (ADR-047 Amendment 4 addendum).
1. An element on one screen gets that screen's views. The browser renders no 3D itself. Each inline-3D element's views come from a zone-scoped
xrLocateViewswithXR_DXR_view_rig(browser patch 0036). The service frames that locate inipc_try_get_sr_view_poses. Until now it always used the session DP's eyes and the window relative to the primary screen.Now, before the zone rebase, the server asks
comp_d3d11_service_get_zone_weave_screenwhether the element lies wholly on a non-primary screen of a window woven per screen. If it does:u_weave_segment_window_metrics);XrViewDisplayRawDXRraw channel, become that screen's eyes, predicted at the locate from its segment DP;The usual zone rebase then places the element on that screen's physical rectangle. The Kooima and rig math are unchanged.
What keeps the primary's views, as before:
The table follows the window, not the session. The browser locates from its browser-process session and weaves from its GPU-process session, and both are bound to its top-level window. The lookup takes the locating client's own fresh weave table (published within the last 250 ms). If there is none, it takes the table of any present-owner whose
weave_hwndis the same window. The first pass holdsclients_mutexonly.render_mutexis taken only for an element that is actually re-framed, to read that screen's fresh eyes. A one-screen window never waits on the render thread.2. Cheap split signal.
weave_submit's reply gains a trailingsegment_count: the count of the table that submit published, read withcomp_d3d11_service_weave_segment_count. It is appended the way the v12weave_submit_dmabuffields were, since the git-tag gate refuses a skewed client/service pair.oxr_weave.cfetchesweave_get_segmentsfor a chainedXrWeaveOutputRectPartsDXRonly when that count is non-zero (u_weave_segments_fetch_needed). A v19 caller therefore pays no extra round trip for a window on one screen, which includes every window on a single-screen box.weave_submit_dmabufis untouched; desktop Linux is never segmented.3. Pure helpers in
u_weave_rect_parts.h:u_weave_rect_single_segmentu_weave_zone_screen_segmentu_weave_segment_window_metrics: the same arithmetic asoxr_segment_views_whole_window_metrics, cross-checked by a test. It lives in aux because the IPC server cannot link the state tracker.u_weave_segments_fetch_neededDocs:
XR_DXR_weave.md§5g: new Cost and Runtime-built views (XR_DXR_view_rig) paragraphs.XR_DXR_display_zones.md§3.3: a multi-screen note on zone-scoped locates.comp-segments.md§ Present-owners.oxr_segment_views_set_capacityis refreshed.There is no extension revision: the locate API is unchanged and the reply field is internal to the wire.
Why
On a box with two 3D panels, an inline-3D element sitting wholly on the second panel was rendered from the primary panel's viewer and framed against the primary panel's rectangle. #1913 already wove it with the right lattice; this fixes the wrong camera. The second part removes the per-submit synchronous
weave_get_segmentsround trip that browser PR #273 flagged on Viz's present thread for one-screen windows.Tests
scripts\build_windows.bat build: clean.ctest -C Release: 111/114 pass. The 3 failures are the known-environmentaltests_oxr_view_space_mode_floor,_pinnedand_floor_off.tests_weave_segments: 15 cases, 197 assertions (8 new, prefixedelement views:). The new cases cover:u_weave_rect_parts'screenRect) at screen 2's pitch. The primary framing was one panel off.u_weave_segments_fetch_neededis false (also false for a legacy single-rect submit and a corrupt count).u_weave_segment_window_metricsis byte-equal tooxr_segment_views_whole_window_metricsfor every segment of two layouts, including a screen at negative desktop x.ipc_weave_submit_reply.segment_countfield trailseyesand fitsIPC_BUF_SIZE.tests_ipc_proto.py: 15 tests OK. A new case pinsweave_submit's out args as[..., "eyes", "segment_count"]andweave_submit_dmabufas unchanged.Program Files, no registry were touched.Rig recipe (two 3D panels side by side, primary on the left)
The browser is the one from browser-pvt #273 (patch 0400, which chains
XrWeaveOutputRectPartsDXR).scripts/push-runtime-pf.sh(it restarts the service non-elevated). Register the dev Leia plug-in if needed.--log-file, and open a page with two inline-3D elements, for example two scene cards side by side.[DisplayXR][multi-screen] segments=2 parts=2, one part per element.multi-screen: element (x,y wxh) wholly on screen 0x… — views from that screen's eyes and geometry (ADR-047 Amendment 4 addendum).segments=0. From then on the submit reply'ssegment_countis 0 and the state tracker skipsweave_get_segments; nothing logs this per frame, and it is covered by the unit test. On a one-screen box the call is never sent.Open questions
xrWeaveSnapWindowRectDXRis called from the browser-process session (patch 0024), whose own compositor never weaves. Soweave_seg_snap_dp(c, …)finds noweave_segs, and the snap falls back to the panel DP: the majority-screen lattice snap from feat(weave): multi-screen M6 for present-owners — weave rects per screen, per-screen eyes out (XR_DXR_weave v19) #1913 is probably never reached by the browser. The same "find the present-owner weaving this HWND" lookup would fix it underrender_mutex. It is left out of this PR to keep scope; it needs a rig check.compositor_get_segment_metricsper locate (Amendment 3,sess->seg_ipc). For a present-owner's browser-process session that answer is always "not the direct presenter". That cost predates this PR and is unchanged here.u_weave_zone_screen_segment.🤖 Generated with Claude Code