Repository navigation
design/feat(lift): in-process lift for engine apps (D3D12) - #1867
Merged
Merged
Conversation
dfattal
force-pushed
the
feat/lift-inprocess-d3d12
branch
from
October 8, 2026 22:59
c86a452 to
d2fea8a
Compare
…over a lift-only connection (ADR-049) XR_DXR_lift was IPC-only, so engine apps, which render in-process (the Unity display provider on its own D3D12 device), got XR_ERROR_FEATURE_UNSUPPORTED. Lift streams belong to a connection, not a session, so an in-process D3D11/D3D12 session on Windows now opens a sessionless APP connection on its first lift call (ipc_client_lift_link: background connect, never launches the service, 5 s retry, refcounted DEAD state + generation) and runs the ordinary lift calls on it. Results are the existing NT-handle texture (no keyed mutex) + shared fence, which ID3D12Device::OpenSharedHandle opens directly. One vendor conversion runtime per machine (shared VRAM, one warm-up, one scheduler) is the deciding reason over an in-process module or a D3D12 DP slot; ADR-049 evaluates the three options. No plug-in, ABI, wire or header change. The IPC-session path is functionally unchanged (its one-line bridges collapse to a connection accessor). A lost lift connection never loses an in-process session. Part of #1858, addresses #1862. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dfattal
force-pushed
the
feat/lift-inprocess-d3d12
branch
from
October 8, 2026 22:59
d2fea8a to
cd6ae9e
Compare
Collaborator
Author
|
Rebased onto main after #1864 + #1868 (win/lift merge train):
Verified locally: 🤖 Generated with Claude Code |
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.
Part of #1858, addresses #1862.
What
XR_DXR_liftwas IPC-only: every in-process session (every engine app, including the Unity display provider, which renders in-process on Unity's own D3D12 device) gotXR_ERROR_FEATURE_UNSUPPORTED. This PR adds ADR-049 and implements its recommendation:An in-process D3D11 / D3D12 session on Windows reaches the service's conversion module over a lift-only, sessionless IPC connection it owns. Rendering stays in-process; conversion stays in the one service. No plug-in, ABI, wire or header change.
Why C (ADR-049 has the full evaluation)
The first vendor conversion runtime keeps its properties process-global and runs on a single worker, so a second process loading it doubles VRAM and warm-up and competes for the GPU with no shared scheduler. One module per machine outweighs a sub-millisecond hop.
The existing export is already D3D12-consumable: an NT-handle texture without a keyed mutex and an
ID3D11FencecreatedD3D11_FENCE_FLAG_SHARED, both opened byID3D12Device::OpenSharedHandle.Implementation
ipc_client_lift_link.{h,c}(new,ipc_client): one sessionlessAPPconnection per in-process session, named<exe> (in-process lift). It connects on a background thread on first use, so the caller never waits; it never launches the service (it dials only when the service's single-instance mutex exists), retries a failed connect at most every 5 s, and has a refcounted DEAD state plus generation counter so a service restart drops the streams but never the session.oxr_lift.c: each call picks a route, either the IPC session's own connection or the in-process session's link, and then runs the sameipc_client_lift_*code. While connecting, properties read ACTIVATING; with no service they read UNAVAILABLE (supportedModes = 0), so the ADR-042 consumer contract works unmodified. Create-stream waits up to 6 s for an in-flight connect. On an in-process session, a dead lift connection returnsXR_ERROR_RUNTIME_FAILUREinstead of losing the session, and its streams then returnXR_ERROR_FEATURE_UNSUPPORTED(recreate them). GL / VK / Metal in-process sessions and non-Windows platforms are unchanged (FEATURE_UNSUPPORTED).ipc_client_compositor.c: the eight one-line lift bridges become one connection accessor. The IPC-session path is functionally unchanged, and the weave-rects bridge is kept.oxr_session.c/oxr_objects.h: the session owns the link and frees it after its lift streams.XR_DXR_lift.md§2 availability, new §5.3 "D3D12 callers" (open/wait the result; D3D12 inputs without a keyed mutex must be completed and double-buffered), §9, §10, §13, version-history note (no SPEC_VERSION bump: detection is unchanged, since an older runtime answers FEATURE_UNSUPPORTED), the Unity app-path doc, CLAUDE.md extension line.Verified
scripts\build_windows.bat build) — see the comment below for the result.Owed (not runnable here: shared box, no service tests)
cube_lift_handle_d3d12_winor a--liftmode incube_handle_d3d12_win): in-process D3D12 session, enableXR_DXR_lift, pollxrGetLiftPropertiesDXRuntil READY, create an SBS stream, render a test image into aD3D12_HEAP_FLAG_SHAREDtexture (double-buffered), signal + CPU-wait,xrSubmitLiftFrameDXR,xrAcquireLiftResultDXR→OpenSharedHandletexture + fence →Wait→ draw the SBS result into the two eye tiles. Expected app-log WARNs:[lift] in-process: lift-only service connection up (generation 1); service log:[lift] stream N export texture WxH fmt=… + fence ready.displayxr-cli clientslists<exe> (in-process lift)as APP without a session.... no service connection for 2D->3D conversion (connect refused or failed) ..., no session loss.... connection (generation 1) is gone ..., the next submit returnsXR_ERROR_FEATURE_UNSUPPORTED, properties go ACTIVATING → READY, and a new stream works (generation 2). The app keeps rendering throughout.OpenSharedHandlefail; it must fall back (follow-up: the lift adapter LUID in properties).Follow-ups (ADR-049)
XrLiftAdapterPropertiesDXR(lift adapter LUID) andXrLiftSubmitSyncDXR(submit-side fence for D3D12 inputs). Both are spec bumps, to be coordinated with ADR-048's bump (feat(lift): window-relative viewpoints + lift viewpoint policy (gains, axis mode, ease-back) #1864).OpenSharedHandleexport + queueWait, check the adapter, and add a C# surface (e.g. a lift component for camera / video textures).🤖 Generated with Claude Code