GPU capture: use the PNG Up filter for coherent scanlines #3779
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3779"
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-28T18:32:49Z.
The diagnostic PNG writer now tries the PNG Up filter when a small sample finds horizontal variation and substantially smaller differences from the preceding row. Unselected images keep the existing filter. The predictor works in place on the RGB scanlines before zlib compression. PNG filtering specification
I compared 50 generated PNG pairs from the actual writer, including RGBA and BGRA input, padded rows, odd sizes and one-pixel extents. An independent decoder checked every RGB sample, dimension and CRC. Twelve selected files were smaller and all 38 controls were byte-identical.
With miniz_oxide 0.9.1 and generated 4K output scanlines, the five-pair local medians for predictor plus compression were:
The flat, vertical-only and high-entropy controls used their original encoded bytes. The 13 capture tests, strict GPU Clippy and the asset policy 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-28T18:37:13Z.
Windows CI passed on
d9e1ac9, including both Clippy configurations and the workspace tests. The independent decoder matched the dimensions, RGB bytes and chunk CRCs for 50 generated PNG pairs. All 12 selected PNGs were smaller and all 38 controls stayed byte-identical.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-29T00:24:36Z.
Independent local verification (Windows, Rust 1.100.0/MSVC, no game data):
d9e1ac9e60803f8f8a1a66a6782ec986d6c1a211, base/parent63bcca43c6a00a758510398fa43096ce7e4f7df0.cargo test --locked -p victory-gpu --lib --features diagnostics -- capture::tests::coherent_png_rows_use_the_up_filter --exact --test-threads=1 --quiet→ 1 passed, 0 failed, 248 filtered, exit 0. Thediagnosticsfeature is required becausemod captureis cfg-gated.git grep -Ffor the new test name on the parent returned no match (test is new on this PR);git diff --check HEAD^ HEADclean (1 file, +74/-0).CARGO_TARGET_DIR(never shared) withCARGO_BUILD_JOBS=2. Two pre-existingfetch_updatewarnings in the library test build.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.