Skip to content

fix(#425): opaque atlas capture + descriptive PNG naming + in-process Unity capture#432

Merged
dfattal merged 1 commit into
mainfrom
fix-425-atlas-capture-opaque-naming
Jun 5, 2026
Merged

fix(#425): opaque atlas capture + descriptive PNG naming + in-process Unity capture#432
dfattal merged 1 commit into
mainfrom
fix-425-atlas-capture-opaque-naming

Conversation

@dfattal
Copy link
Copy Markdown
Collaborator

@dfattal dfattal commented Jun 5, 2026

Closes #425.

Hardens xrCaptureAtlasEXT and bumps XR_EXT_atlas_capture SPEC_VERSION 1 → 2.

What

  • Opaque alpha at all 6 encode sites via new u_image_force_opaque_rgba8 (auxiliary/util/u_image_capture.h) — captures were fully transparent → black. Applied across d3d11/d3d12/gl/metal/vk_native + comp_d3d11_service.cpp.
  • Descriptive PNG naming …_atlas_<viewCount>_<cols>x<rows>.png, built only at the EXT-contract layer (oxr_capture.c in-process; comp_d3d11_service.cpp IPC). Callers pass a bare <stem>-<N> prefix; the *_capture_atlas_to_png cores write verbatim (MCP capture_frame + dev triggers unaffected). test_apps/common/atlas_capture.* + macOS cube apps updated.
  • In-process D3D11 capture via d3d11_compositor_dispatch_capture_zerocopy() reading the zero-copy swapchain SRV directly — single-shared-swapchain projection layers (Unity in-process, zero-copy eligible) no longer silently drop the capture. Shared core refactored to d3d11_capture_texture_to_png().
  • Diagnostics cleanup (oxr_system.c / oxr_session.c): engine probe instances (Unity/Unreal create a zero-extension throwaway instance that can never start a session) no longer emit a misleading "Legacy app" WARN at xrCreateInstance. Provisional-scale log downgraded to INFO; the authoritative LEGACY-session WARN now fires in oxr_session_create only when the compromise scale actually drives rendering.

Coupled merge order

Spec bump 1 → 2: merge this runtime PR first, let publish-extensions auto-sync, then the displayxr-unity / displayxr-unreal plugin PRs (each pins the v2 header).

Verification

Verified on native test apps, demo apps, and the Unity + Unreal plugins (in-process and IPC). The Unity-only aspect issue was a project graphics-API setting (D3D11 → D3D12), tracked separately in displayxr-unity#142.

🤖 Generated with Claude Code

… Unity capture

xrCaptureAtlasEXT hardening (XR_EXT_atlas_capture SPEC_VERSION 1->2):

- Opaque alpha at all 6 encode sites via new aux helper
  u_image_force_opaque_rgba8 (u_image_capture.h) — forces A=255 so captures
  are no longer fully-transparent/black. Applied in d3d11/d3d12/gl/metal/
  vk_native compositors + comp_d3d11_service.cpp.

- Runtime-owned PNG suffix _atlas_<viewCount>_<cols>x<rows> built only at the
  EXT-contract layer (oxr_capture.c in-process resolves the active mode tile
  layout via GET_XDEV_BY_ROLE(head); comp_d3d11_service.cpp IPC). Callers
  pass a bare <stem>-<N> prefix; the *_capture_atlas_to_png cores write
  verbatim. test_apps/common/atlas_capture.* + the macOS cube apps updated to
  pass the bare prefix.

- In-process D3D11 capture: dispatch via d3d11_compositor_dispatch_capture_
  zerocopy() reading the zero-copy swapchain SRV directly, so single-shared-
  swapchain projection layers (Unity in-process, zero-copy eligible) no longer
  silently drop the capture. Shared core refactored to
  d3d11_capture_texture_to_png(tex, w, h, path).

- Diagnostics: stop the misleading "Legacy app" WARN at xrCreateInstance for
  engine probe instances (Unity/Unreal create a zero-extension throwaway
  instance that can never start a session). oxr_system_fill_in downgrades the
  provisional-scale log to INFO; the authoritative LEGACY-session WARN now
  fires in oxr_session_create only when the compromise scale actually drives
  rendering.

Verified on native test apps, demo apps, and the Unity/Unreal plugins.
@dfattal dfattal merged commit 964277f into main Jun 5, 2026
21 checks passed
@dfattal dfattal deleted the fix-425-atlas-capture-opaque-naming branch June 5, 2026 09: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.

xrCaptureAtlasEXT writes a fully-transparent (alpha=0) PNG — renders black

1 participant