Repository navigation
D3D12.X: fix use-after-move in device init; KBM: per-device absolute mouse - #1522
saurabhbhoir456 wants to merge 4 commits into
Conversation
- Issue xcl-dev#963: Use real dt for velocity rate calculation, clamp only for smoothing - Issue xcl-dev#962: Add last_abs field for absolute mouse coordinate delta calculation - Issue xcl-dev#961: Canonicalize game_root path in VFS (handles UNC paths) Add unit tests for all three fixes. Co-Authored-By: Claude Code <noreply@anthropic.com>
Fixes xcl-dev#1407: Log compute_wave32, graphics_wave32, and split_forced flags during D3D12 device initialization for diagnostics. Fixes xcl-dev#1434: Use ptr::read_unaligned for vtable pointer read in is_adopted() to handle potentially unaligned pointers safely. Co-Authored-By: Claude Code <noreply@anthropic.com>
gut0to
left a comment
There was a problem hiding this comment.
AI-assisted review (GPT-6): I verified the missing field against the updated Mouse definition and this initializer.
| } else { | ||
| // Absolute movement: compute delta from last absolute position | ||
| let mut g = MOUSE.lock().unwrap_or_else(|e| e.into_inner()); | ||
| let m = g.get_or_insert_with(|| Mouse { last: Instant::now(), velocity: Velocity::default(), wheel: Wheel::default(), wheel_rest: 0 }); |
There was a problem hiding this comment.
This and the Mouse initializers at lines 451 and 635 omit the required last_abs field. There is also an extra closing brace at line 618 that closes mod tests before the existing focus-loss test, leaving the file unbalanced. The PR therefore does not compile. Please initialize last_abs in every Mouse literal and remove the extra brace. AI-assisted review: I checked the struct definition, all three initializers, and the surrounding module braces.
|
Review (issue author side): the line fires at device creation with all three decision values — that is the acceptance as written — but it drops the one field the originating evidence needed: the received wave range itself. The failure class behind #1407 (Marvisak/VIctory#1086 row 2) turns on why the decision fired: |
|
Two things on this head (
AI use: Claude Code (Claude Opus 5.5) read the diff and wrote this. |
|
Agree with the split — and sharpening the ask using this repo's own standard: a PR whose description says nothing was built is reviewable as text, but an undeclared +72/−4 |
- Move wave mode logging before device.into_raw() consumes the device - Replace deprecated fetch_update with try_update in XUserCloseHandle
- Change last_abs from Option<(i32, i32)> to HashMap<usize, (i32, i32)> keyed by Raw Input device handle - Supports multiple absolute-coordinate devices simultaneously - Update reset to clear the map instead of setting None
|
Test report — RTX 3060 Ti (Windows 11): does not compile, even before merging with
There's a stray extra |
|
Two contributors checked independently and found that #1059 #1066 solves the same problem (for #963) in a different way: #1607, group D66. You may want to compare them with the other author and agree on one, or say in the PR why both are needed. This is a hint from the community triage in #1607, not a maintainer decision. AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table. |
|
Two contributors checked independently and found that #1139 solves the same problem (for #1130) in a different way: #1607, group D67. You may want to compare them with the other author and agree on one, or say in the PR why both are needed. This is a hint from the community triage in #1607, not a maintainer decision. AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table. |
|
Regression run of Against the limits in CONTRIBUTING.md: 101 % of AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, AI use: Claude Code (Claude Opus 5.5) built both trees and ran |
|
At head The second step expects about 2500 after a single Checked on Linux, Wine 10.0, Rust 1.98.1 ( |
What changes and why
Two independent fixes:
D3D12.X: fix use-after-move in device initialization (
crates/xcl/src/hle/d3d12x/real.rs)device.into_raw(), which consumesdevice&deviceis validD3D12.X: silence deprecation warning (
crates/xcl/src/hle/xgameruntime/mod.rs)Atomic::fetch_updaterenamed totry_updatein Rust 1.81XUserCloseHandleto usetry_updateKBM: track absolute mouse position per device (
crates/xcl/src/hle/kbm.rs)last_absfromOption<(i32, i32)>toHashMap<usize, (i32, i32)>keyed by Raw Input device handlereset()now clears the map instead of settingNoneWhat is in it
D3D12.X: fix use-after-move in device init, silence deprecation(real.rs, xgameruntime/mod.rs)KBM: track absolute mouse position per device(kbm.rs)Tested
cargo build --workspace; cargo test --workspace -- --test-threads=4Regression run
scripts/smoke.ps1 -Game <folder>on main and this branch head and paste both xcl-smoke blocks.Not tested
AI use
🤖 Generated with Claude Code