d3d12: time the mirror and shadow sync as a submit profile stage #507

Closed
ReverendOzmund wants to merge 1 commit from upstream-pr/507 into main
ReverendOzmund commented 2026-11-29 17:27:11 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by ReverendOzmund on 2026-11-29T17:27:11Z.


Summary

Before each batch the provider copies CPU writes into the constant-buffer mirrors and, on hosts that can't import section-backed game memory, into every live shadow copy. That ran outside every submit profile stage, so it only showed up as batch time nothing else explained. gtb-sbe measured it at 80–160 ms per direct batch on RADV in #472. It now has its own mirror stage in TUXBOX_SUBMIT_PROFILE.

Tested

  • cargo check --tests --target x86_64-pc-windows-msvc for runtime/d3d12
  • The submit profile window test covers the new stage
  • tuxbox.py check on RTX 3080 Ti: (fill in after the run)

🤖 Generated with Claude Code

https://claude.ai/code/session_01KP1nQKEc17PvmrwfPtLi8Z

<!-- greyfinch-sync:brcly/TuxBox:issue:5553224671 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/507). Originally posted by [ReverendOzmund](https://github.com/ReverendOzmund) on 2026-11-29T17:27:11Z. --- ## Summary Before each batch the provider copies CPU writes into the constant-buffer mirrors and, on hosts that can't import section-backed game memory, into every live shadow copy. That ran outside every submit profile stage, so it only showed up as batch time nothing else explained. gtb-sbe measured it at 80–160 ms per direct batch on RADV in #472. It now has its own `mirror` stage in `TUXBOX_SUBMIT_PROFILE`. ## Tested - `cargo check --tests --target x86_64-pc-windows-msvc` for runtime/d3d12 - The submit profile window test covers the new stage - `tuxbox.py check` on RTX 3080 Ti: (fill in after the run) 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01KP1nQKEc17PvmrwfPtLi8Z
ReverendOzmund commented 2026-11-29 17:32:30 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by ReverendOzmund on 2026-11-29T17:32:30Z.


This overlaps #498, which adds the same stage as Stage::Shadow and also speeds up the sync. The only extra here is timing the CBV mirror snapshot, which is normally empty. Happy to close this in favour of #498.

<!-- greyfinch-sync:brcly/TuxBox:comment:7259772386 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/507#issuecomment-7259772386). Originally posted by [ReverendOzmund](https://github.com/ReverendOzmund) on 2026-11-29T17:32:30Z. --- This overlaps #498, which adds the same stage as `Stage::Shadow` and also speeds up the sync. The only extra here is timing the CBV mirror snapshot, which is normally empty. Happy to close this in favour of #498.
brcly commented 2026-11-29 20:19:45 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-29T20:19:45Z.


Closing in favour of #498, which is merged and adds the same Stage::Shadow timing. Thanks for offering, and for the CBV mirror snapshot idea: if that snapshot ever turns out not to be empty in practice, a small PR timing just that would be welcome.

<!-- greyfinch-sync:brcly/TuxBox:comment:7261991098 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/507#issuecomment-7261991098). Originally posted by [brcly](https://github.com/brcly) on 2026-11-29T20:19:45Z. --- Closing in favour of #498, which is merged and adds the same `Stage::Shadow` timing. Thanks for offering, and for the CBV mirror snapshot idea: if that snapshot ever turns out not to be empty in practice, a small PR timing just that would be welcome.

Pull request closed

Sign in to join this conversation.
No reviewers
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
brcly/TuxBox!507
No description provided.