Skip to content

refactor(test-apps): migrate Windows cube_handle capture to xrCaptureAtlasEXT [#396 W6]#400

Open
dfattal wants to merge 1 commit into
mainfrom
feat/396-w6-testapp-capture-migration
Open

refactor(test-apps): migrate Windows cube_handle capture to xrCaptureAtlasEXT [#396 W6]#400
dfattal wants to merge 1 commit into
mainfrom
feat/396-w6-testapp-capture-migration

Conversation

@dfattal
Copy link
Copy Markdown
Collaborator

@dfattal dfattal commented Jun 3, 2026

Summary

W6 consumer migration (test apps) of #396. All four Windows cube_handle_* apps now capture the atlas via the runtime (XR_EXT_atlas_capture) instead of per-API GPU readbacks, behind one shared helper — net −350 lines.

Refactor (test_apps/common)

  • New dxr_capture::RequestRuntimeAtlasCapture(xr, appName, cols, rows, hwnd) in atlas_capture.cpp (sr_common_base): the single graphics-API-agnostic capture path — 3D-mode guard + MakeCaptureAtlasPrefix numbering + xrCaptureAtlasEXT (PROJECTION_ONLY) + flash + logging. Each app's ~30-line I-key block → one call.

Migration (d3d11 / d3d12 / gl / vk _win)

  • main.cpp: capture block → RequestRuntimeAtlasCapture(); dropped the per-API CaptureAtlasRegion* fallback (test apps always run against this repo's runtime, which exports the ext).
  • xr_session.cpp (d3d12/gl/vk): detect + enable + resolve XR_EXT_atlas_capture, mirroring d3d11.

Dead-code removal

  • Deleted atlas_capture_d3d11.cpp + atlas_capture_d3d12.cpp (Windows-only, now unused) and their declarations; removed the D3D11 readback from sr_common and the per-API TUs from the d3d12/gl/vk app CMakeLists.
  • Kept atlas_capture_{gl,vk}.cpp + atlas_capture_metal.mm — the macOS cube_handle apps still use them and are not migrated here (can't build/verify on Windows; follow-up on a Mac).

Verification (in-process, real display)

  • d3d11 (helper refactor) and d3d12 (new PFN resolve): I → a tight 1280×360 two-view PNG via xrCaptureAtlasEXT (xrCaptureAtlasEXT: resolved + Atlas capture requested).
  • gl / vk: build + link with the identical pattern (capture path is the shared helper).

Follow-ups

  • macOS cube_handle_{metal,gl,vk}_macos migration (needs a Mac) — then atlas_capture_{gl,vk}.cpp + atlas_capture_metal.mm can go too.
  • Demos (gauss, modelviewer) + Unity/Unreal consumer migration.

🤖 Generated with Claude Code

…AtlasEXT [#396 W6]

W6 consumer migration (test apps). All four Windows cube_handle_* apps now use
the runtime-owned capture (XR_EXT_atlas_capture) instead of per-API GPU
readbacks, behind one shared helper.

Refactor (test_apps/common):
- New dxr_capture::RequestRuntimeAtlasCapture(xr, appName, cols, rows, hwnd) in
  atlas_capture.cpp (sr_common_base): the single, graphics-API-agnostic capture
  path — 3D-mode guard + MakeCaptureAtlasPrefix numbering + xrCaptureAtlasEXT
  (PROJECTION_ONLY) + flash + logging. Collapses each app's ~30-line I-key block
  to one call.

Migration (d3d11/d3d12/gl/vk_win):
- main.cpp: capture block -> RequestRuntimeAtlasCapture(); dropped the per-API
  CaptureAtlasRegion* fallback (test apps always run against this repo's runtime).
- xr_session.cpp (d3d12/gl/vk): detect + enable + resolve XR_EXT_atlas_capture,
  mirroring d3d11.

Dead-code removal:
- Deleted atlas_capture_d3d11.cpp + atlas_capture_d3d12.cpp (Windows-only, now
  unused) and their declarations; removed the D3D11 readback from sr_common and
  the per-API TUs from the d3d12/gl/vk app CMakeLists.
- Kept atlas_capture_{gl,vk}.cpp + atlas_capture_metal.mm — the macOS cube_handle
  apps still use them and are NOT migrated here (can't build/verify on Windows;
  follow-up on a Mac).

Verified e2e (in-process, real display): d3d11 (helper refactor) and d3d12 (new
PFN resolve) each press-I -> a tight 1280x360 two-view PNG via xrCaptureAtlasEXT;
gl/vk build + link with the identical pattern. Net -350 lines.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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