GPU: copy compatible multisampled texture aliases directly #2312
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2314"
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 andrewpozdnakov7-jpg on 2026-11-25T10:27:03Z.
A multisampled alias could go through the linear-buffer path in alias_copy. D3D12 requires matching sample counts for the copy. The multisampled path now uses CopyResource when the actual host dimensions, mip counts, sample descriptions and format families match. It keeps the current main's deferred host writes. D3D12 copy rules
The same WARP test clears a synthetic 4x MSAA D32_FLOAT texture to 0.375 and its R32_FLOAT alias to -0.5. On main at
67e8ae1401, closing the list after the alias copy returns E_INVALIDARG. With8c8cfb4, the list closes and all 16 resolved pixels read 0.375. Serial victory-gpu on WARP passed with 199 passed and 1 ignored in both debug flag settings. Strict GPU Clippy in both modes and repository policy passed. In five parallel runs per arm, the existing submission-copy test failed twice on main and three times on the patch. The descriptor rewrite test also failed once on the patch.Coordination claim
Please preserve the Git author when reapplying the change. If you fold the code or test into another commit, please add this trailer.
Co-authored-by: andrewpozdnakov7-jpg [email protected]
AI-assisted. Synthetic tests only.
Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T10:43:12Z.
Review: APPROVED
Verified against
origin/main(940d32f) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP:CopyResourcecleanly preserves all samples without going through a staging buffer.cargo test -p victory-gpu resource::tests: 11/11 passed on RTX 5090 (includingmultisampled_aliases_copy_all_samples).cargo test -p victory-gpu texture::tests: 2/2 passed on RTX 5090, 2/2 passed on WARP.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 catminou4 on 2026-11-25T10:54:03Z.
Review: COMMENTED
Copy-compatible multisampled texture aliases copy all samples directly (+104 host-GPU test). 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.
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-25T11:02:11Z.
I checked the overlap with #2275 at
b6a9ebe. Git reports a conflict beside the start ofalias_copy. The tested combinationdac5b2bkeeps the direct MSAA path first and checks the array mip count before the single-sample footprint path. It preserves both original histories and includes both WARP readback tests.Both regressions passed together. Full forced-WARP GPU suite gave 149 passed, 2 ignored. GPU Clippy in both feature modes and repository policy passed. #2274 at
8a88297merges cleanly with this PR individually (textual merge checked).If you fold our changes or tests into another commit, please keep:
Co-authored-by: andrewpozdnakov7-jpg [email protected]
AI-assisted. Synthetic tests only.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T15:26:26Z.
Automated triage for the maintainers.
Merge candidate.
On main,
texture::alias_copysends multisampled aliases through the single-sample buffer-footprint path, which gives an invalid list (E_INVALIDARGatClose). This PR copies them withCopyResourcewhen the sample description, dimensions, mip and array counts and format family (resource::family) match. Otherwise it logs once and skips the copy. The checks match D3D12'sCopyResourcerules, and the existing host-write and state transitions are kept throughprepare. The WARP testmultisampled_aliases_copy_all_samplesclears a 4x D32 depth texture and its R32 alias to different values, copies, resolves and checks every pixel, so it tests what is correct rather than what the code does.This overlaps
alias_copyin #2275. Whichever merges second will need a small rebase; the author has posted a tested combination.CI (
check): passing.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-25T16:28:50Z.
Updated the branch for current main at
67e8ae1401. The same WARP test fails at native command list Close with E_INVALIDARG on main and resolves all 16 pixels to 0.375 with the patch. Serial GPU tests passed in both debug flag settings (199 passed, 1 ignored). The existing submission-copy test was intermittent in parallel on both revisions. The descriptor rewrite test failed once in the patched parallel runs. Strict GPU Clippy and repository policy passed.Updated branch commit
If you fold the change or test into another commit, please preserve the Git author or add this trailer.
Co-authored-by: andrewpozdnakov7-jpg [email protected]
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T19:00:27Z.
Review: APPROVED
Reviewed
8c8cfb4f8559merged cleanly onto63bcca43.The direct multisampled copy path in
crates/victory-gpu/src/texture.rs:252-290handles MSAA texture aliases cleanly:CopyResourcebehind exact agreement onSampleDesc,(Dimension, Width, Height, DepthOrArraySize, MipLevels), andresource::family(Format)(texture.rs:274-284), falling back to a logged skip for incompatible multisampled aliases instead of routing them through a single-sample linear staging buffer.preparehelper (texture.rs:268-272) sohost_writes(list, to)andCOPY_SOURCE/COPY_DESTtransitions stay consistent with the single-sample path.Hardware & D3D12 Debug Layer verification (RTX 5090 + Microsoft WARP,
VICTORY_D3D12_DEBUG=1):cargo xtask policyandcargo clippy --locked -p victory-gpu --all-targets -- -D warnings(default and--all-features) pass cleanly.resource::tests::multisampled_aliases_copy_all_samplespasses on both RTX 5090 and WARP underVICTORY_D3D12_DEBUG=1.4x->1x,4x->2x,4x4->8x8, andR32_TYPELESS->R8G8B8A8_UNORM4x) and 2 compatible 4x MSAA pairs (D32_FLOAT->R32_FLOATandD16_UNORM->R16_UNORM): all 4 incompatible cases skipped without incrementingALIAS_COPIES, both compatible cases copied directly viaCopyResource,GetDeviceRemovedReason().is_ok(), andhost.log_messages() == Noneon both RTX 5090 and WARP.#2319and#2358on63bcca43with all three GPU tests passing underVICTORY_D3D12_DEBUG=1on both adapters.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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.