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

Closed
opened 2026-11-25 17:43:17 +00:00 by KOLESNiii · 0 comments
KOLESNiii commented 2026-11-25 17:43:17 +00:00 (Migrated from github.com)
Contributor

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-25T17:43:17Z.


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.

<!-- greyfinch-sync:ivall/xcl:issue:6610265313 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/2391). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-25T17:43:17Z. --- 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.*
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl#2381
No description provided.