Repository navigation
GPU: copy compatible multisampled texture aliases directly - #2314
andrewpozdnakov7-jpg wants to merge 2 commits into
Conversation
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified against origin/main (940d32f) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP:
- Allowing compatible multisampled texture aliases to copy directly via
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).
catminou4
left a comment
There was a problem hiding this comment.
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.
|
I checked the overlap with #2275 at 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 If you fold our changes or tests into another commit, please keep: Co-authored-by: andrewpozdnakov7-jpg andrewpozdnakov7-jpg@users.noreply.github.com AI-assisted. Synthetic tests only. |
|
Automated triage for the maintainers. Merge candidate. On main, This overlaps CI ( Generated by Claude Code |
|
Updated the branch for current main at 67e8ae1. 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. If you fold the change or test into another commit, please preserve the Git author or add this trailer. Co-authored-by: andrewpozdnakov7-jpg andrewpozdnakov7-jpg@users.noreply.github.com |
fuzeofficlal
left a comment
There was a problem hiding this comment.
Reviewed 8c8cfb4f8559 merged cleanly onto 63bcca43.
The direct multisampled copy path in crates/victory-gpu/src/texture.rs:252-290 handles MSAA texture aliases cleanly:
- Guards
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. - Shares the
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.- Verified an additional Debug Layer probe exercising 4 incompatible MSAA pairs (
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. - Also verified a clean 3-way co-merge with
#2319and#2358on63bcca43with all three GPU tests passing underVICTORY_D3D12_DEBUG=1on both adapters.
LGTM.
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 67e8ae1, closing the list after the alias copy returns E_INVALIDARG. With 8c8cfb4, 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 andrewpozdnakov7-jpg@users.noreply.github.com
AI-assisted. Synthetic tests only.