Device-method slot interface names + exit-time call summary (on top of #376) #495
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/495"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from fxceless/victory-fork. Originally posted by ZaneIceMaster11 on 2026-11-25T01:35:38Z.
Depends on #376 (VICTORY_SHADER_DIAG) - this diff includes that PR's changes too since GitHub won't let a PR target a branch that only exists on the fork. Once #376 merges this will shrink to just
device.rs/lifecycle.rs.What this adds
Addresses a review comment on #376: when a slot number is in the detail field, name the resolved D3D12 interface too, and add a per-slot total at process exit next to the running per-call counter.
Interface resolution
Computed exact PC vtable slot boundaries for IUnknown through ID3D12Device4 directly from the pinned
windows0.62.2 crate source (counting eachID3D12DeviceN_Vtbl's fields, accounting for how windows-rs keeps feature-gated fields at a fixed slot with a dummy type rather than removing them - confirmed this by reading the actual generated vtable structs, not assuming). Deliberately hedged pastID3D12Device4(slot 56): this module's own doc comment already says the title's vtable only matches PC order until "console additions follow", and I found that boundary is demonstrably at or before Device5 - the file's existing hand-written comment claims Device5/Device8 each add 9 methods, but the pinned crate has 8 and 5. Both slots this project actually hits (0x1c8,0x218) are past that boundary, so they now report"ID3D12Device5-or-later, console layout may diverge from PC here"rather than a wrong confident name - a bad guess here would be worse than the honest uncertainty.Exit summary
unknown_pipeline's per-monomorphizationstatic CALLS: [AtomicU32; 2](a separate array per const-genericSLOT, despite looking shared) became one module-levelMutex<BTreeMap<usize, u32>>both instantiations write into, soreport_unimplemented_calls()can summarize every slot at once. Called fromlifecycle::end()next to the existing pipeline-cache save, since the process terminates viaTerminateProcessthere (noatexit/normal shutdown runs).Verification
Real run (Series X, opening cutscene, no crash): exit summary printed exactly as designed, matching the live per-call counters seen during the run (
slot=0x1c8 calls=25450,slot=0x218 calls=2689). Build, clippy (-p victory-gpu -p victory-hle --all-targets --release --features diagnostics), and tests (213, both crates) all clean.Co-authored with Claude Code (Claude Sonnet 5).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.