GPU: fix texture footprint span and committed-range overflow with unit tests #935
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#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?
@geiyiliyabumo on GitHub · 2026-11-24 14:20 UTC · original
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.
@MichaelSmithAI on GitHub · 2026-11-24 14:34 UTC · original
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.
@Marvisak on GitHub · 2026-11-25 06:51 UTC · original
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