GPU: aliased texture arrays with other mip counts are not copied subresource by subresource #2275
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!2275
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2275/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?
@denkencar-sketch on GitHub · 2026-11-25 09:29 UTC · original
denkencar-sketch:fix/tex-002→main· +28 −0 · 1 files · 1 commits · closed without mergingSummary
Aliased texture arrays with other mip counts were copied subresource by subresource, but their subresource numbers name different mips and slices, so one slice's mip went into another slice.
subresources_correspondnow allows the per-subresource copy only when the mip counts match.Testing
Test
array_subresources_correspond_only_with_as_many_mipsfails ifsubresources_correspondalways returns true and passes with this change; it covers the helper, not the call 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.
@Dathinel on GitHub · 2026-11-25 09:55 UTC · original
Tested #2275 (
b6a9ebe) together with #2274 (8a88297) on Windows. Both changes share base940d32f. The two textual conflicts are at helper/test insertion points; keeping both helpers and both tests compiled. The call-site edits combined automatically.I supplied synthetic RGBA32F and BC7 descriptions to D3D12 GetCopyableFootprints and checked the resulting prefix in both directions:
All three selected tests passed. This checks the native layout metadata and both selection rules. GPU copy execution and resulting texels were outside this run. AI-assisted, synthetic descriptors only.
@andrewpozdnakov7-jpg on GitHub · 2026-11-25 10:51 UTC · original
I added a WARP readback regression on top of your exact head
b6a9ebe00182abf29a77aaf8097d4412b4e355c6. Test commitb9020a9.The source is a two-slice, one-mip R32G32_UINT texture with two synthetic BC1 blocks. The destination is a two-slice, two-mip BC1 texture at the same title address, initialized to blue. The fixture resolves the alias through
alias_source, recordsalias_copy, submits the list and reads the packed destination blocks back.940d32fwith the same test, array slice 1 overwrites mip 1 of destination slice 0 with the green block0x07e0.b6a9ebe, the tested mip retains its original blue block0x001f. Full forced-WARP GPU library suite gives 148 passed, 2 ignored. GPU Clippy in both feature modes and repository policy passed.Please preserve the Git author if you cherry-pick this test. If you fold it into another commit, please add:
Co-authored-by: andrewpozdnakov7-jpg [email protected]
AI-assisted. Synthetic tests only.
@Marvisak on GitHub · 2026-11-25 13:32 UTC · original
Automated triage for the maintainers.
Merge candidate (worth a look).
texture::alias_copycopied aliased textures by subresource index; for arrays whose mip counts differ, indexinames a different mip/slice in each (D3D12 numbers subresources mip-major within a slice), and the footprint comparison onmaindoes not always catch that. The newsubresources_correspondskips such pairs (with aonce!log), which leaves the destination stale instead of writing a slice into another slice's mip; a tester reproduced the wrong copy onmainon WARP and its absence with this head. CIcheckpasses and it merges cleanly. Note: #2274 edits the same function and the two conflict textually (a tester merged both by hand); copying the common mips slice by slice could be a later improvement over skipping.Generated by Claude Code
@Marvisak on GitHub · 2026-11-25 22:07 UTC · original
Automated triage for the maintainers, second look (a review against current
main, with builds and tests where they could change the verdict).Closing because the fix is worse than
mainwhere it applies. It returns before copying anything, so subresource 0 and the first slice's common mips, which do correspond, are no longer copied, andhost_writesis not called, so the destination falls back to stale title memory. The helper also tests only the source's array size. The problem is real in principle; copying by (mip, slice) for the mips below the smaller count would be the right change.If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.
Pull request closed