Skip to content

feat(vk dp, weave/linux): set_overlay_2d VK slot — 2D under the lens on Vulkan - #1823

Merged
dfattal merged 2 commits into
mainfrom
feat/vk-dp-overlay-2d
Oct 5, 2026
Merged

dfattal merged 2 commits into
mainfrom
feat/vk-dp-overlay-2d

Conversation

@dfattal

@dfattal dfattal commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

What

Vulkan twin of the D3D11 set_overlay_2d / set_overlay_2d_filter_strength slots (#1814 / #1822, ADR-027 Amendment), and the desktop-Linux weave engine as its first producer. Needed by DisplayXR/displayxr-leia-plugin's Linux port of "2D under the lens" (SR SDK srWeaverSetComposeInputsVulkan).

Interface (xrt_display_processor_vk.h)

  • Appended after set_transparency_active (ADR-020, no ABI major; asserts + size bumped 15 → 17):
    • bool set_overlay_2d(xdp, VkImageView, VkFormat_XDP, w, h, enum xrt_atlas_encoding, bool layer_unchanged)
    • void set_overlay_2d_filter_strength(xdp, float) (negative = DP default)
  • Macros XRT_DP_VK_HAS_OVERLAY_2D, XRT_DP_VK_HAS_OVERLAY_2D_FILTER_STRENGTH; helpers xrt_display_processor_vk_supports_overlay_2d / _set_overlay_2d / _set_overlay_2d_filter_strength.
  • Contract = the D3D11 one (stateless per frame, target-sized, premultiplied, ENCODED, RGBA8/BGRA8; true = DP composites inside the next process_atlas, false/absent = runtime blends post-weave), plus: layer in SHADER_READ_ONLY_OPTIMAL, owned by process_atlas' queue family, alive until that command buffer completes. The PRESENT_SRC_KHR target contract is unchanged.

Producer (comp_multi_weave_linux.c)

  • When the frame weaves, the v4 overlay is exactly output-sized and the DP has the slot: acquire + transition the overlay before the self-submitting split, call strength, then set_overlay_2d with the submit's v14 overlay_unchanged.
  • DP took it: the full-window post-weave blend is skipped. Off-panel bands and flat regions are painted over the weave afterwards (clear + flat copy), so the overlay is redrawn over those rects only and 2D stays readable across the seam as before.
  • DP declined: exactly the old path (the overlay may already be acquired; the release is shared).
  • One WARN on each change of verdict: weave: 2D overlay (WxH) composited by the display processor INSIDE the weave / blended post-weave by the runtime.
  • IPC: overlay_unchanged / overlay_filter_strength (already on the wire) are forwarded on both Linux submit paths via comp_multi_weave_linux_set_overlay_hints (per submit, like v13 mono).

Docs: ADR-027 Amendment + XR_DXR_weave v14/v15 notes.

Not done

  • The macOS / Android Vulkan weave engines and the in-process vk_native Local2D-over path don't call the slot yet (same shape when needed).
  • v6 N-view submits: the overlay is window-sized but the output is one content view, so the size check keeps them on the runtime blend.

Testing

  • ./scripts/build_linux.sh --hybrid --apps green; clang-format clean; scripts/tests/test_downstream_pin_bump.py OK.
  • weave_present_vk_linux --headless 90 against a private-XDG displayxr-service with DXR_PLUGIN_EXCLUSIVE=sim-display (no slot): PASS (incl. "HUD overlay composited over the weave"); the log shows the runtime-blend verdict.
  • DP path: the plug-in side builds against this branch (leia-plugin PR). The on-panel check (DS1) is pending with David.
  • The features downstream-pin gate should pick up the new XRT_DP_VK_HAS_* macros for leia's Linux track on the next release.

🤖 Generated with Claude Code

…on Vulkan

Append xrt_display_processor_vk::set_overlay_2d + set_overlay_2d_filter_strength
(XRT_DP_VK_HAS_OVERLAY_2D[_FILTER_STRENGTH], ADR-020 append, no ABI major) — the
Vulkan twin of the D3D11 slots from #1814/#1822. Same contract: stateless per
frame, layer target-sized, premultiplied, ENCODED sRGB, RGBA8/BGRA8; true = the
DP composites it inside the next process_atlas, false/absent = the runtime keeps
its post-weave blend. VK specifics: a VkImageView + VkFormat, in
SHADER_READ_ONLY_OPTIMAL when process_atlas' command buffer executes.

First producer: the desktop-Linux weave engine. When the frame weaves and the v4
overlay is exactly output-sized, it acquires the overlay and transitions it
before the self-submitting split, offers it to the DP (v15 strength first, v14
unchanged hint from the submit), and skips its own full-window blend when the
DP takes it. Off-panel bands and flat regions are painted over the weave
afterwards, so the layer is redrawn over those rects only, keeping 2D readable
across a seam as before. One WARN on each change of who composites. The IPC
handler forwards overlay_unchanged / overlay_filter_strength on both Linux
submit paths (they were already on the wire).

sim_display has no slot, so its path is unchanged: weave_present_vk_linux
--headless 90 PASSes (HUD composited) with the runtime-blend verdict logged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ransparency size check follows the append

tests_comp_lazy_transparency pinned the VK variant's total size at 15 appended
slots, which the set_overlay_2d append (ADR-020) correctly grows to 17 — it now
checks that the next slot follows set_transparency_active directly.
tests_comp_overlay_2d_vk pins both new slots' offsets and that a plug-in whose
struct_size ends before a slot is never called through it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@dfattal
dfattal merged commit 65bb857 into main Oct 5, 2026
40 checks passed
@dfattal
dfattal deleted the feat/vk-dp-overlay-2d branch October 5, 2026 08:24
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