Skip to content

feat(win): one D3D12 DP per screen — create_dp_d3d12_for_screen + D3D12 present origin (multi-screen M6) - #323

Merged
dfattal merged 3 commits into
mainfrom
feat/win-d3d12-dp-segments
Oct 10, 2026
Merged

dfattal merged 3 commits into
mainfrom
feat/win-d3d12-dp-segments

Conversation

@dfattal

@dfattal dfattal commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Depends on

DisplayXR/displayxr-runtime#1879 (appends xrt_plugin_iface::create_dp_d3d12_for_screen and xrt_display_processor_d3d12::set_present_origin, ABI unchanged at 5) — shipped in runtime v2.33.0. This branch is rebased on main after #333 (Windows pin → v2.33.0) and #334 (Linux pin), so CI now compiles the new D3D12 paths (XRT_PLUGIN_IFACE_HAS_CREATE_DP_D3D12_FOR_SCREEN / XRT_DP_D3D12_HAS_PRESENT_ORIGIN are defined) instead of compiling them out.

What

The D3D12 twin of the D3D11 per-screen DP (e58d56e / a786eee / b44a454), for the in-process D3D12 compositor the Unity display provider runs on:

  • leiasr_d3d12_create_for_screen + leiasr_d3d12_set_present_origin (leia_sr_d3d12.{h,cpp}), on the shared plan in leia_sr_multi_win.h: EXTERNAL routing (+ KEEP_DRAG_SNAP only with a real window) + display binding chained on the DX12 weaver create-info with the bind-then-routing fallback; the runtime's active display read at create; a weaver bound to a non-active display with no tracker of its own (SR D4 off) skips srInitialize and pins the nominal viewer; SR D3 bound lens per screen, disabled before destroy; per weave, a windowless EXTERNAL weaver gets srWeaverSetPresentOrigin and a pinned one srWeaverSetSimulatedViewer again (one-shot log of the first pinned weave's eye pair). The unbound create is byte-for-byte the old one (one shared impl).
  • leia_dp_factory_d3d12_for_screen (leia_display_processor_d3d12.{h,cpp}): binding → SR display id (the binding's own, else leia_win_claims_lookup), DP around the per-screen weaver; the vtable/state setup both D3D12 factories share moves into leia_dp_d3d12_init; set_present_origin (slot 24) forwards to the weaver.
  • Registered in leia_plugin.c under XRT_PLUGIN_IFACE_HAS_CREATE_DP_D3D12_FOR_SCREEN.
  • New: get_screen_status (runtime ADR-051 D2, appended after create_dp_d3d12_for_screen in v2.33.0), passive only: ready = cached platform state READY, verified = the claim's SR FPC_VERIFIED match, serial = its FPC serial, tracker UNSUPPORTED, lens UNKNOWN, no model, no warnings, no dashboard_command. It reads only the claim table and the lock-free platform state: no SR handle, no SR SDK call, no probe. change_counter = claim-set generation (bumped by leia_win_claims_store only when the stored set actually differs) combined with the platform state. Guarded by XRT_PLUGIN_IFACE_HAS_GET_SCREEN_STATUS.

Canvas confinement needs nothing new on this arm: process_atlas already hands the weaver viewport + scissor = canvas and sets both on the command list (leiasr_d3d12_weave). SR SDK pins untouched. D3D12 late latching stays off (unchanged).

Tests

  • Rebased cleanly on origin/main (no conflicts); origin/main..HEAD = this PR's 3 commits only.
  • Local Windows build, scripts\build-windows.bat build (fresh build dir), against the runtime checkout at exactly v2.33.0 (b47fc4277, clean, unchanged before/after the build): exit 0. leia_plugin.c.obj references leia_dp_factory_d3d12_for_screen and leia_plugin_get_screen_status, and the DLL carries the Leia D3D12 per-screen DP strings, so both #ifdef branches are active. No new compiler warnings from plug-in sources.
  • No host-testable logic changed in the D3D12 path (the plan in leia_sr_multi_win.h is reused as-is; test_sr_multi_win runs on the Linux CI).
  • Rig check pending (supervisor). Rig recipe is on runtime#1879; the plug-in-side lines to look for: Leia D3D12 per-screen DP: monitor 0x… -> SR display 0x…, SR D3D12 per-screen weaver: display 0x…, window 0000000000000000, caps{…} -> plan{external=1 …}, SR D3D12 weaver created via the v2 C API (EXTERNAL routing, display bound) [windowless: phase from the present origin], and on a non-active panel … simulated nominal viewer PINNED … then first weave with the pinned viewer — predicted eyes … (PAIR — weaving). displayxr-cli status should show a leia-sr vendor cell per claimed screen (ready / verified / FPC serial).

🤖 Generated with Claude Code

dfattal and others added 3 commits October 10, 2026 11:16
…t origin, nominal viewer (multi-screen M6)

leiasr_d3d12_create_for_screen + leiasr_d3d12_set_present_origin, the
D3D12 twins of the D3D11 per-screen weaver, on the shared plan in
leia_sr_multi_win.h:

- create_v2 queries the multi caps, plans EXTERNAL routing (+ drag snap
  only with a real window) + display binding, chains them on the DX12
  weaver create-info with the bind-then-routing fallback, and reads the
  runtime's active display.
- A screen-bound weaver on a non-active display with no tracker of its
  own (SR D4 off) skips srInitialize and pins the nominal viewer; a bound
  lens (SR D3) is created for its display and handed back to 2D at
  destroy; otherwise the lens is left to the active panel.
- Before every weave a windowless EXTERNAL weaver gets the present origin,
  and a pinned one its simulated viewer again, with a one-shot log of the
  first pinned weave's eye pair.

The unbound create is unchanged (both entry points share one impl).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…12 set_present_origin (multi-screen M6)

- leia_dp_factory_d3d12_for_screen: resolves the binding to an SR display
  id (the binding's own, else this plug-in's per-monitor claim via
  leia_win_claims_lookup) and builds the DP around a per-screen weaver.
  The vtable/state setup both D3D12 factories share moves into
  leia_dp_d3d12_init.
- set_present_origin (slot 24) forwards to the weaver, under
  XRT_DP_D3D12_HAS_PRESENT_ORIGIN.
- Registered in the iface under
  XRT_PLUGIN_IFACE_HAS_CREATE_DP_D3D12_FOR_SCREEN; against older runtime
  headers both compile out.

Canvas confinement needs nothing new: process_atlas already hands the
weaver viewport + scissor = canvas and sets both on the command list.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Fill the dashboard cell for a claimed screen from what the plug-in already
published: ready = cached platform state READY, verified = the claim's SR
FPC_VERIFIED match, serial = its FPC serial. Tracker UNSUPPORTED, lens
UNKNOWN, no model, no warnings, no dashboard_command. No SR handle, no SR
SDK call, no probe: the claim table + lock-free platform state only.

change_counter = claim-set generation (bumped by leia_win_claims_store only
when the stored set differs) combined with the platform state, so a poller
skips an unchanged screen. Compiled only when the runtime headers announce
XRT_PLUGIN_IFACE_HAS_GET_SCREEN_STATUS (v2.33.0+).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dfattal
dfattal force-pushed the feat/win-d3d12-dp-segments branch from 577a07f to e692b5a Compare October 10, 2026 18:28
@dfattal
dfattal marked this pull request as ready for review October 10, 2026 18:28
@dfattal
dfattal merged commit b618a18 into main Oct 10, 2026
16 checks passed
@dfattal
dfattal deleted the feat/win-d3d12-dp-segments branch October 10, 2026 19:12
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