GPU capture: stream compressed PNG chunks to disk #3763
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3763"
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 Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T16:57:05Z.
Write the PNG chunks through a buffered file writer. The compressed IDAT payload stays in its original allocation, and the uncompressed scanlines are released before opening the output file.
Five generated captures matched main byte for byte, including padded BGRA, one pixel, and both flat and high-entropy 4K inputs. An independent decoder verified all chunk CRCs and inflated the scanlines. With the normal half-size output, the high-entropy 4K input produced a 6,222,923-byte PNG on both revisions.
In the same optimized Windows test, peak live Rust allocations above the input buffer went from 31.11 MB to 18.92 MB for the high-entropy 4K input, and from 7.78 MB to 4.92 MB for 1080p. The flat 4K control stayed at about 9.59 MB. Across six alternating pairs, the measured encode-and-write medians varied by about 3–4% in either direction. This change targets the memory used by captures.
Six diagnostics capture tests passed, including the new byte-exact IDAT regression. Strict GPU Clippy, the asset policy and the diff check passed.
Please retain the Git author on cherry-pick or rebase, or add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>if folding the change into another commit.AI-assisted with OpenAI Codex.
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T17:00:44Z.
Windows CI passed on
ed3c64c, including both Clippy configurations and the workspace tests. All five generated PNGs matched main byte for byte. On the high-entropy 4K input, peak additional live Rust allocations fell from 31.11 MB to 18.92 MB. The actual PNG file stayed at 6,222,923 bytes in both runs.The next step is maintainer review. Please retain the Git author on cherry-pick or rebase, or add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>if folding the change into another commit.AI-assisted with OpenAI Codex.
Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-28T17:06:10Z.
Independent local verification (Windows, Rust 1.100.0/MSVC, no game data):
ed3c64cf115e605844034060d93ecafe4f61d2da, base/parent63bcca43c6a00a758510398fa43096ce7e4f7df0.cargo test --locked -p victory-gpu --lib --features diagnostics -- capture::tests::png_chunk_writes_the_type_and_payload_crc --exact --test-threads=1 --quiet→ 1 passed, 0 failed, 247 filtered, exit 0. Thediagnosticsfeature is required:mod captureis gated onall(windows, feature = "diagnostics")inlib.rs. Two pre-existing warnings in the victory-gpu lib test build.git grep -Ffor the test name on the parent returned no match (test is new on this PR);git diff --check HEAD^ HEADclean (1 file, +41/-23).CARGO_TARGET_DIR(target-3763-watch),CARGO_BUILD_JOBS=2. Only the named synthetic test was replayed; full workspace suite and clippy were not run locally.AI-assisted (Hy4 flash).
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.