Measurement switches: VICTORY_CAPTURE_WORLD_EVERY and VICTORY_HIDDEN_WINDOW=1 #1039
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1039"
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 trustno1-coder/VIctory-NVIDIA. Originally posted by OtavMacedo on 2026-11-28T11:50:42Z.
Two small switches for unattended measurement runs. Both are off unless set: with neither variable set, VIctory-NVIDIA behaves exactly as today.
VICTORY_CAPTURE_WORLD_EVERY=<n>With
VICTORY_CAPTURE_WORLD, every 8th frame after the first frame of 500 draws or more is saved, and the 8 is fixed incapture::wanted. A saved frame is read back and written as a PNG inside the present, so that frame runs several times longer than the frames around it. Any frame-time measurement taken with world captures on therefore has a regular dip every 8 frames.VICTORY_CAPTURE_WORLD_EVERY=<n>(a positive whole number) sets the interval, e.g.64for a run that measures speed but still wants a picture now and then.0, negative or not a number: 8, as before.parse_everyis split out with a unit test for those cases.VICTORY_HIDDEN_WINDOW=1The title's top-level window is made right of the virtual desktop (
SM_XVIRTUALSCREEN + SM_CXVIRTUALSCREEN + 64), withWS_EX_TOOLWINDOW(out of the taskbar) andWS_EX_NOACTIVATE. A test run can then go on while someone uses the machine. The swap chain presents to the window as usual: the window is shown, just not on any screen.parentnot null).VICTORY_FULLSCREENandVICTORY_MOUSE_CAPTUREleave the window alone. Fullscreen'sSetWindowPoswould move it back to 0,0, and the capture would clip the cursor to an off-screen rectangle.enabled): only=1turns it on.Both switches come from VItoria Spark, which uses them for its unattended runs. Its
VICTORY_HIDDEN_WINDOWaccepts any value but0. Here it takes=1like the other switches inlifecycle.rs, and it also skips fullscreen and the mouse capture, which Spark does not have.Files
crates/victory-gpu/src/capture.rs:world_every,parse_every, and a test.crates/victory-hle/src/modules/lifecycle.rs:hidden_window,hide(called inCreateWindowExW/CreateWindowExAafterfit), plus guards infullscreenandcapture_mouse.How to test
VICTORY_CAPTURE=<dir> VICTORY_CAPTURE_WORLD=1, world pictures are still saved every 8th frame.VICTORY_CAPTURE=<dir> VICTORY_CAPTURE_WORLD=1 VICTORY_CAPTURE_WORLD_EVERY=64: world pictures come every 64th frame after the first 500-draw frame (the 2nd/6th-frame and power-of-two pictures stay).VICTORY_HIDDEN_WINDOW=1: the log hastitle window made off the screens (VICTORY_HIDDEN_WINDOW). No window shows on any monitor or in the taskbar, and the game keeps presenting (fps lines and captures go on). WithVICTORY_FULLSCREEN=1as well, the window still stays off the screens.Validated on hardware (RTX 3070 8 GB, driver 32.0.16.2124, Windows 11, 16 GB RAM)
This patch was applied to a VIctory-NVIDIA tree at
64d4931and built as diag. In one short run with both switches:VICTORY_HIDDEN_WINDOW=1: the log hastitle window made off the screens (VICTORY_HIDDEN_WINDOW) x=1984. Checked from outside during the run: window rectangle 1984..3818 against a virtual desktop of 0..1920, extended style 0x08000180 (WS_EX_TOOLWINDOWandWS_EX_NOACTIVATE), and the window title kept showing fps.VICTORY_CAPTURE_WORLD_EVERY=64: 116 PNGs. Before the world, the existing early pictures. In the world, one every 64 frames (…1693, 1757, 1821, 1885, …), plus the power-of-two ones.a host command list did not close (0x8007000E), with 740 MB left to commit on that 16 GB machine. That is the out-of-memory crash already reported in #576, and it is not related to these switches. Their effect on frame times was not measured.Checks run (Linux, cross-compiled for
x86_64-pc-windows-msvcwith cargo-xwin, onmainat63b902f)cargo xwin clippy -p victory-gpu -p victory-hle --all-targets --locked, with and without--all-features: no warning in the touched files. The warnings left (2 without features, 3 with) are older ones indescriptor.rs,shadow.rsandgameinput.rs, which this PR does not touch, so CI's clippy step with-D warningsstays red for reasons unrelated to this PR.cargo xtask policy: ok.--features diagnostics: 503 passed and 4 failed. The 4 arewatch::*tests that depend on Windows memory behaviour Wine lacks; they also failed onmainunder Wine.captureis compiled only withdiagnostics, so CI'scargo test --workspacedoes not run its tests.capture::gives 3 of 3 passed, the newworld_capture_interval_defaults_to_eightamong them.net::only_loopback_is_reachableandxgamesave::a_kept_blob_past_the_link_limit_is_copied). Both also fail onmainunder Wine.lifecyclegives 11 of 11 passed.victory.wndprocproperty (3f054e4). The off-screen window still gets that property from our window procedure hook, so it is still the one presented to.cargo xwin build --profile diag -p victory --features diagnostics): it builds, with no rustc warning.🤖 Generated with Claude Code
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.