GPU: fix texture footprint span and committed-range overflow with unit tests #935
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 geiyiliyabumo on 2026-11-24T14:20:17Z.
Summary
Fixes 2 real defects in
crates/victory-gpu/src/texture.rs(previously 0 unit tests) and adds 9 deterministic synthetic unit tests.Because external PR creation is currently restricted (
collaborators_only), the CI-green branch is ready on my fork for cherry-pick / review:geiyiliyabumo/VIctory@test/gpu-texture-auditgeiyiliyabumo/VIctory@1456fe7(based onmainffe310e)Changes (
crates/victory-gpu/src/texture.rs)Verification (Windows 11 x64 MSVC)
rustfmt --edition 2024 --check crates/victory-gpu/src/texture.rs: PASScargo xtask policy: PASS (154 files ok)cargo clippy -p victory-gpu --all-targets --locked -- -D warnings(default +--features diagnostics): PASS (0 warnings)cargo test -p victory-gpu --locked -- texture::(default +--features diagnostics): 9 passed, 0 failedAI-assisted; synthetic tests only, no game files.
Imported from Marvisak/VIctory. Originally posted by MichaelSmithAI on 2026-11-24T14:34:26Z.
On
1456fe7, a test-only GPU readback exercised the production texture upload on an RTX 4090 under Wine with vkd3d-proton 3.2. The input was a tiled 5×6 RGBA8 texture with 120 distinct bytes. The staging buffer was 1,300 bytes and the subresource range was0..1300(five 256-byte pitches plus the final 20 bytes). After upload, all six rows matched the input byte for byte, including the last row.All ten texture tests passed with diagnostics enabled (the nine authored tests plus this readback). The GPU case covers a single mip and array slice. Title use and any change in rendered output remain unmeasured.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T06:51:32Z.
Automated triage for the maintainers.
Both defects look fixed on current
main(merge256d7b9, today). Incrates/victory-gpu/src/texture.rs,subresource_lennow clamps a subresource's span tototal - offset, so a 5x6 RGBA8 upload stays at the 1,300-byte footprint (testsubresource_len_stays_inside_staging_total), andcommitteduseschecked_addand returnsfalseon an overflowing range instead of panicking. The extra unit tests on1456fe7would still be welcome as a pull request (pull requests are open to everyone now). Proposed for closing as fixed inmain: it will be closed in 48 hours unless the reporter replies or a maintainer removes the label.Generated by Claude Code