GPU: display mode changes and devices added or removed go to the log and to the removal report's trail #1002
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1004"
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 PiloteCode on 2026-11-25T15:40:13Z.
Based on
4c604661(main). Two commits, two small changes to the window procedure inhost.rs: about 20 lines.Rebuilt on today's
main: the two clippy fixes it started with are gone (mainis clippy-clean now), and the two commits are re-applied unchanged.Why
On our test machine, Windows reset the card several times in one day ("Resetting TDR" from the display driver), and each reset ended the run under way with its host device lost. The system's own logs showed what came before: each time, 2.5 to 4.6 s earlier, a remote-desktop host had ended its session and removed its virtual input device. Nothing in our log showed it, so the losses first looked like ours.
What changes
Our window now notes two messages the system sends every top-level window:
WM_DISPLAYCHANGE, with the new size and bits per pixel ("the display's mode changed");WM_DEVICECHANGEwithDBT_DEVNODES_CHANGED("a device was added to or removed from the system").Each goes to the log and to the trail (
host::trail). The report of a lost device prints the trail with how long before the loss each entry came, so the report says whether a display or device change preceded the loss.In every build, with no switch: two log lines per change, which is rare. The window procedure otherwise does as before (
DefWindowProcW).Tested
The branch was checked as it is, on
4c604661, on the software adapter:cargo test -p victory-gpu --features diagnostics -- --test-threads=1 --skip stacks_that_mean_nothing_are_walked_without_a_faultwithVICTORY_D3D12_WARP=1: 247 passed, 7 ignored, none failed, as onmain. The skipped test ends the test process with an access violation on this machine, onmaintoo.cargo clippy --workspace --all-targets --locked -- -D warnings, and the same with--all-features: clean.cargo build --release -p victoryandcargo build --profile diag -p victory --features diagnosticspass.cargo xtask policyfails onmainitself:host.rs(534,239 bytes) andemit/lower.rs(546,915) are over the 524,288-byte limit. This branch adds 991 bytes tohost.rsand names no other file.In our tree, these lines have been in every run since they went in. No unit test: the messages come from the system.
Not tested
Where this also lives
These changes are also in PiloteBox (https://github.com/PiloteCode/PiloteBox), a tree kept up to date for NVIDIA cards. Its 0.13.1 runs the Series X profile at about 21 frames a second on an RTX 5090 (46.6 and 48.8 ms a frame in one scene; its changelog says how that was measured).
Imported from fxceless/victory-fork. Originally posted by PiloteCode on 2026-11-25T22:11:42Z.
Merged
main(c36971b) into the branch: a merge commit on top of the commits already here (d1d247d), then one lint commit. No conflict: this branch's change is inwindow_proc, whichmain's commits since0b0074edo not touch.Added after the merge: one lint commit for
main's newer code, the same as on our other open branches:map_entryinfpsbox.rs,collapsible_ifinpipeline/library.rs,manual_is_multiple_ofinqueue.rs,shadow.rs,draw.rsandwatch.rs. Without itcargo clippy --workspace --all-targets --locked -- -D warningsfails onc36971b, with or without--all-features.Checked, the branch as it is (
66fa13b), every test on the software adapter:cargo clippy --workspace --all-targets --locked -- -D warnings, and the same with--all-features: clean.cargo xtask policy,cargo build --release -p victoryandcargo build --profile diag -p victory --features diagnostics: pass.cargo test -p victory-gpu --features diagnostics -- --test-threads=1withVICTORY_D3D12_WARP=1: 200 passed, 1 failed, 6 ignored, as onmain. The failure isdepth_bounds_pipeline_loads_and_filters_draws: WARP does not reject the pixels outside the depth bounds.cargo test -p victory-shader -- --test-threads=1withVICTORY_WARP=1: 212 passed, 4 failed, 3 ignored, the same four as onmainon the software adapter.cargo test -p victory-hle -- --test-threads=1: 100 + 1 passed, as onmain.cargo test -p victory -p victory-loader: passed.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.