GPU: require texture copy footprints to fit a complete row #3034
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!3034
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3034"
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?
@andrewpozdnakov7-jpg on GitHub · 2026-11-26 04:12 UTC · original
andrewpozdnakov7-jpg:codex2/footprint-row-pitch→main· +52 −4 · 1 files · 1 commits · openCopyTextureRegionusesPlacedFootprintto size upload staging and to read back the requested rows. Each calculation now checks that the full unpadded row fits withinRowPitch. For block compression, the row size is the number of horizontal blocks times the bytes per block.The same synthetic footprint test on
63bcca4accepts an undersized pitch for both RGBA8 and BC1 through both calculations. This revision rejects both, including a small region within the incomplete footprint. Exact-fit and padded pitches still return the expected row offsets and final byte count. The regression tests the layout calculations directly.Valid guest upload and readback tests and the full Agility WARP GPU suite passed (247 passed, one ignored). The diff applies cleanly beside either #3006 or #3022. Strict GPU Clippy with and without diagnostics and the repository asset policy passed. This follows the optional row-width notes in #3006 and #3022. D3D12_SUBRESOURCE_FOOTPRINT Coordination claim
AI-assisted with Codex. Synthetic inputs.
@pawrenity on GitHub · 2026-11-26 05:04 UTC · original
VERIFY-3034: verified
374aadeon NVIDIA GeForce RTX 4070, Windows 11 (MSVC). No defects found.a_placed_footprint_pitch_covers_a_complete_row, with only the test hunk applied to origin/main63bcca4, fails withaccepted short row pitches: [(28, true, true), (71, true, true)](both RGBA8 and BC1 accepted throughbytes()androws()). It passes at head.cargo test -p victory-gpu --libat head: 230 passed, 1 ignored, 2 failed. The two failures aredynamic_slots_are_held_until_releasedandlists_share_a_table_and_copies_keep_their_views, which also fail on main on this card (capped view heap). The existing footprint, upload and readback tests inresource::testsall pass.cargo clippy -p victory-gpu --all-targets -- -D warningsis clean, with and without--features diagnostics.63bcca4is clean.Review (reading only): the row size
ceil(width / block) * elementmatches D3D12_SUBRESOURCE_FOOTPRINT (RowPitch must hold at least one full row; BC rows are counted in 4x4 blocks). The test values check out: 65 RGBA8 texels are 260 bytes, 129 BC1 texels are 33 blocks of 8 = 264 bytes, and one texel fewer gives exactly 256. Buffer footprints (format 0) and the internally generatedcopyable_footprintslayouts never fall below the row size, so they are unaffected. When a pitch is too short, the upload path (list.rs~726) returns without recording, as it already does for an unsized format. The readback path (list.rs~853) reports it asrefused!("a region outside its footprint"), so the log reason is slightly loose for this case but the behaviour is correct.AI-assisted (Claude Code).
@Marvisak on GitHub · 2026-11-26 06:18 UTC · original
Automated triage for the maintainers.
PlacedFootprint::bytesandrows(crates/victory-gpu/src/resource.rs) now returnNonewhenRowPitchis shorter than one unpadded row (ceil(width / block) * element). BothCopyTextureRegionpaths inlist.rspass the title's footprint to the host with only its offset changed. Without this check, a too-short pitch reaches host D3D12, which requiresRowPitchto hold a full row (publicD3D12_SUBRESOURCE_FOOTPRINTdocs). With it, the upload path skips the copy and the readback path refuses it, as both already do for unsized formats.mainalready checks the 256-byte pitch alignment, so this completes the validation. Unsized formats (elementreturnsNone) behave as before. I checked the test values: 65 RGBA8 texels = 260 bytes, and 129 BC1 texels = 33 blocks of 8 bytes = 264. The change is defensive, since a well-formed title call never hits it, but it is small and keeps an invalid call away from the host driver. It sits beside #3006 and #3022 in the same file, and the author says it applies cleanly with either.CI:
checkpassing.Generated by Claude Code
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.