GPU: aliased texture arrays with other mip counts are not copied subresource by subresource #2273
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2275"
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 denkencar-sketch on 2026-11-25T09:29:02Z.
Summary
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.
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T09:35:43Z.
Review: COMMENTED
Aliased texture arrays with different mip counts are not copied (subresources_correspond guard). Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1. Complements #2274; same alias_copy area.
Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T10:04:00Z.
Review: APPROVED
Verified against
origin/main(940d32f) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP:resource::alias_sourcealready requires matchingdimensionanddepth_or_array_size, sosubresources_correspondaccurately guards texture arrays with differing mip counts while allowing single-slice textures and 3D textures to copy their common mip prefix.cargo test -p victory-gpu texture::: 3/3 passed on RTX 5090, 3/3 passed on WARP (includingarray_subresources_correspond_only_with_as_many_mips).cargo clippy -p victory-gpu --all-targets -- -D warnings: 0 warnings.cargo xtask policy: 183 files ok.AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by Dathinel on 2026-11-25T09:55:37Z.
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.
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-25T10:51:54Z.
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.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T13:32:52Z.
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
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T22:07:47Z.
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