D3D12.X: XCL_ACTIVITY counts and times the per-draw buffer mirror sync #2391

Open
opened 2026-11-26 05:29:49 +00:00 by github-bot · 0 comments
Owner

@⁠KOLESNiii on GitHub · 2026-11-25 17:43 UTC · original

Part of #2389. This should come first, so the other parts have before/after numbers.

list_x::sync_title_buffers (crates/xcl/src/hle/d3d12x/list_x.rs:3539 on main 3f4495a) runs on every DrawInstanced / DrawIndexedInstanced (bind.rs:476, bind.rs:489) and DrawIndexedX (list_x.rs:3831) once any buffer mirror exists. Nothing reports what it costs today: the only output is the "mirrored at …, each draw copies what it reads" warning when a mirror is made.

Proposal: add one line to XCL_ACTIVITY=1 every 2 s with, for the last 2 s:

  • draws that went through the sync, and draws that found a mirror to update
  • bytes copied, and how many copies were whole buffers (the instances > 1 / unknown-range branch)
  • indices scanned for the vertex range
  • readable() calls that fell back to VirtualQuery (more than 16 pages)
  • total time spent in the function

This is diagnostics only, with no change in behaviour. With it, a run in a title's world shows whether the other parts are worth doing.

Found by code reading with Claude Code (Claude Opus 5.5); not measured yet.

**@⁠KOLESNiii** on GitHub · 2026-11-25 17:43 UTC · [original](https://github.com/xcl-dev/xcl/issues/2391) Part of #2389. This should come first, so the other parts have before/after numbers. `list_x::sync_title_buffers` (`crates/xcl/src/hle/d3d12x/list_x.rs:3539` on `main` 3f4495a) runs on every `DrawInstanced` / `DrawIndexedInstanced` (`bind.rs:476`, `bind.rs:489`) and `DrawIndexedX` (`list_x.rs:3831`) once any buffer mirror exists. Nothing reports what it costs today: the only output is the "mirrored at …, each draw copies what it reads" warning when a mirror is made. **Proposal:** add one line to `XCL_ACTIVITY=1` every 2 s with, for the last 2 s: - draws that went through the sync, and draws that found a mirror to update - bytes copied, and how many copies were whole buffers (the `instances > 1` / unknown-range branch) - indices scanned for the vertex range - `readable()` calls that fell back to `VirtualQuery` (more than 16 pages) - total time spent in the function This is diagnostics only, with no change in behaviour. With it, a run in a title's world shows whether the other parts are worth doing. *Found by code reading with Claude Code (Claude Opus 5.5); not measured yet.*
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:29:49 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.