GPU: skip zero-sized frame captures #488
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!488
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/488/head"
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?
@enzoduarte1 on GitHub · 2026-11-24 03:58 UTC · original
enzoduarte1:gpu/capture-zero-extent→main· +22 −2 · 1 files · 1 commits · closed without mergingWhat
save_asin the frame-capture diagnostics computed the source row and pixel withheight as usize - 1andwidth as usize - 1. A zero-sized present underflowed (panic in debug, huge index in release) even though the code then clamped withmin.Zero-width or zero-height frames are now skipped: they have no pixels to sample, and the row slice can be empty. The clamping itself moved into a
source_coordhelper so its boundary behavior is testable without writing PNGs. Tests cover zero extent, normal clamping and the no-op on an empty frame.Tested
x86_64-pc-windows-gnu(no MSVC linker on this machine).cargo test -p victory-gpu --features diagnostics --lib: 46 passed, 1 ignored.cargo test --workspace --exclude victory-loader -- --test-threads=1: all suites passed.cargo clippy -p victory-gpu --all-targets --features diagnostics -- -D warnings: clean here; the pre-existinghost.rswarning fixed by PR #355 appears on a full rebuild and was allowed locally.git diff --check: clean.rustfmt --checkshows only unrelated pre-existing formatting in this file; the added lines match it.cargo xtask policy: 151 files ok. No game files or data taken from them were added.cargo test -p victory-loader --test load_probe. Its fixture passes MSVC's/DELAYLOADflag, which MinGW rejects here; the same failure occurs on unmodifiedmain.Checklist
cargo fmt,cargo clippy --workspace --all-targetsandcargo test --workspacepass — see the toolchain limitations above; the changed crate is clean.cargo xtask policypasses. The change adds no game files or data taken from them (docs/asset-policy.md).@DaviTostes on GitHub · 2026-11-24 04:02 UTC · original
Verified
62cf5ddon Arch Linux x86_64, Windows MSVC release build under Wine 11.22 (victory-gpu,--test-threads=1): 43 passed, 0 failed, 1 ignored.Not covered: a zero-sized capture actually requested at run time in the title (no game data here); the suite has no case for the capture path.
@Marvisak on GitHub · 2026-11-25 00:03 UTC · original
Automated triage for the maintainers. Closing because it does not change behaviour the project needs (formatting, guards for cases that cannot occur, or notes and translations that cannot be kept current).
Guards the capture writer against a 0x0 frame, which cannot reach it: both callers pass the footprint of a live host texture (width and height >= 1). Its test's save(1, 0, 0, ..) returns at folder() before the new guard, so it tests nothing.
If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Pull request closed