GPU: aliased textures copy only the subresources that have the same bytes per row #2274
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!2274
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2274"
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?
@denkencar-sketch on GitHub · 2026-11-25 09:28 UTC · original
denkencar-sketch:fix/tex-001→main· +54 −13 · 1 files · 1 commits · openSummary
Aliased textures were copied subresource by subresource when mips had the same footprint and rows but another row width, through a buffer sized for only one of them.
common_subresourcesnow keeps only the subresources with the same bytes per row.Testing
Test
aliased_subresources_need_the_same_bytes_per_rowfails without thesa == sbrow-pitch check and passes with this change; it covers the helper, not thealias_copycall site.cargo test --workspace --lockedpasses apart from the known flakes:modules::dstorage::tests::a_page_list_filled_after_its_request_startsfails now and then onmaintoo, and so does a parallel-run flake invictory-gpu's lib tests (watch::anddescriptor::host::tests, 2 of 40 runs on pristinemain).Not tried: a run in the game.
AI-assisted.
@Marvisak on GitHub · 2026-11-25 13:32 UTC · original
Automated triage for the maintainers.
Worth a look:
texture.rsalias_copycopies subresources in order while their offsets, row pitch, row count and depth match. It does not compare the row size in bytes, so a pair such as a 25x16 RGBA32 texture and a 100x64 BC7 texture (mip 1: 192 against 208 bytes a row) was copied out of a buffer sized from texture A's footprints with texture B's, reading past its end. The PR also takesGetCopyableFootprints' row sizes and stops at the first subresource where they differ (common_subresources); its unit test numbers check out. CI passes. It touches the same lines as #1888 (a larger rework of the same function, which does not add this check), so whichever lands second needs a rebase.Generated by Claude Code
@fuzeofficlal on GitHub · 2026-11-26 00:50 UTC · original
Code review and RTX 5090 + WARP verification at head
8a88297df004merged cleanly ontomain(63bcca43c6a0):crates/victory-gpu/src/texture.rs:249-326):common_subresourcesaddspRowSizeInBytes(sa[i] == sb[i]) alongsideOffset,RowPitch, row count (ra[i] == rb[i]), andDepthfromGetCopyableFootprints.100x64BC7 vs25x16RGBA32) where mip 0 matches but mip 1 sharesRowPitch = 256/rows = 8/Offset = 8192while differing in actual row byte width (208B vs192B), ensuring thetotal-byte staging buffer allocated fromfastrictly coversfb[0..n]. Stopping at the first mismatched subresource viatake_whileis conservative on multi-slice arrays but safe.VICTORY_D3D12_DEBUG=1, Rust 1.98.1):cargo xtask policy:191 files ok;cargo clippy -p victory-gpu --all-targets -- -D warnings(default +--features diagnostics): 0 warningstexture:: resource::tests: 21/21 passed on both RTX 5090 and WARP (--features diagnostics).LGTM.
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.