GPU: use selected mip extents for MSAA resolves #652
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!652
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-652"
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?
@fuzeofficlal on GitHub · 2026-11-24 06:14 UTC · original
fuzeofficlal:fix/resolve-selected-mip→main· +323 −22 · 1 files · 1 commits · openProblem
MSAA resolve compares the full dimensions of the source and destination textures. A 4×4 source and a destination with a 4×4 base mip take the full-resolve path even when the selected destination mip is 2×2. On the RTX 5090 the larger source was averaged into the smaller mip, changing the expected top-left pixel from
[0, 0, 32, 255]to[32, 32, 42, 255]. The D3D12 debug layer reported no error.Change
Use the dimensions of the selected subresources both to choose between full and region resolve and to size the existing top-left crop. The mip is the low-order component of an array or plane subresource index.
Verification
d2a4baethe patterned readback passed 2/5 cases on RTX 5090 and 5/5 on WARP. With the patch both passed 5/5, with zero D3D12 debug errors and the unselected base mip unchanged.All readback inputs were synthetic.
@justr4mzi on GitHub · 2026-11-24 09:27 UTC · original
Tested PR #652 (
ea09cb04) merged cleanly ontomain(8e79c80) on Windows 11 with an AMD Radeon RX 6700 XT (RDNA2) and Rust 1.98.1 (x86_64-pc-windows-msvc).8e79c80(crates/victory-gpu/src/list.rs, +11/-5).cargo test -p victory-gpu -- --test-threads=1: 50 passed, 0 failed, 1 ignored (same onmain8e79c80baseline; PR adds no new unit test).cargo test -p victory-gpu --features diagnostics -- --test-threads=1: 53 passed, 0 failed, 1 ignored (same onmain8e79c80).cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy:153 files ok.AI-assisted verification (reviewed locally).
@fuzeofficlal on GitHub · 2026-11-24 10:47 UTC · original
I ran the patterned selected-mip readback on
ea09cb04using AMD Radeon(TM) Graphics (DXGI1002:13c0, verified against the native device LUID). All five synthetic cases passed, including the nonzero destination mip at three sizes, array slice 1, and an automatically sized mip chain. Every selected mip matched the expected texels and each untouched base mip stayed cyan.The D3D12 callback reported zero errors or corruption during recording and execution. This run covers the patched revision on this AMD adapter.
@fuzeofficlal on GitHub · 2026-11-24 16:39 UTC · original
Rebased onto
ffe310eand folded inresolve_uses_the_selected_mip_dimensionscovering selected-mip and array-slice MSAA resolve readbacks (including 4x4 source -> 4x4 destination mip 1 and expanded mip chains) across hardware and WARP.@Marvisak on GitHub · 2026-11-25 00:32 UTC · original · edited 2026-11-26 00:21 UTC
Automated triage for the maintainers.
Merge candidate.
list::resolve(crates/victory-gpu/src/list.rs) now picks between a fullResolveSubresourceand a croppedResolveSubresourceRegionin the newresolve_region. It uses the extents of the selected mips (subresource % MipLevels, matching D3D12's subresource numbering) rather than the base dimensions, and the crop uses the same extents.On your reply: the second-look points are done. The test compiles against the owned
host_resourceand drains the debug queue before asserting. It now assertsresolve_region's decision for every case: 4x4 into mip 1 of a 4x4 texture gives a 2x2 crop, and 4x4 into mip 1 of 8x8 takes the full path. So it fails againstmain's base-dimension logic on every host, not only on adapters that show the corruption. The branch merges cleanly.CI: passing.
Generated by Claude Code
@Marvisak on GitHub · 2026-11-25 22:01 UTC · original
Automated triage for the maintainers, second look (a review against
main, with the PR built and tested).The fix is right (a resolve uses the selected mips' extents), and this can be merged after a change to its test. The test no longer compiles on current
main, wherehost_resourcereturns an owned resource: incrates/victory-gpu/src/list.rs,resolve_uses_the_selected_mip_dimensionsneedshost.rtv(&src_tex, None),host.rtv(&dst_tex, Some(&desc))andread_resolve_test_mip(device, &recorded.list, &dst_tex, sub). Please also drain the debug queue before the first assert (let _ = host.log_messages();once the textures are made), so the test does not fail underVICTORY_D3D12_DEBUG=1on a list-setup message. For what it is worth: with those borrows fixed, the test passes with and without the fix on an RX 6700 XT and on WARP, so a case that fails onmainwould make it stronger.Push the change and it will be reviewed again. Thank you for the contribution.
@fuzeofficlal on GitHub · 2026-11-25 22:39 UTC · original
Updated and rebased onto
main(f3578e3) in292789dper second-look feedback:host_resourceborrows inresolve_uses_the_selected_mip_dimensions(host.rtv(&src_tex, None),host.rtv(&dst_tex, Some(&desc)), andread_resolve_test_mip(..., &dst_tex, sub)).let _ = host.log_messages();) right after creating the test textures so list-setup messages don't trip underVICTORY_D3D12_DEBUG=1.resolve_regionand asserted its exact decision for every test case (e.g.,4x4MSAA ->4x4mip 1 (2x2) requiresSome(RECT 0..2, 0..2)rather than fullResolveSubresource,4x4MSAA ->8x8mip 2 (2x2) requires0..2rather than0..4, and4x4MSAA ->8x8mip 1 (4x4) takesNonefor fullResolveSubresource), so the test fails againstmain's base-dimension logic on every host in addition to catching D3D12 debug-layer validation errors.list::tests::resolve_uses_the_selected_mip_dimensionson RTX 5090, RTX 5090 +VICTORY_D3D12_DEBUG=1, and WARP +VICTORY_D3D12_DEBUG=1(0 debug messages), pluscargo clippy -p victory-gpu --all-targets(default &--features diagnostics, 0 warnings) andcargo xtask policy(190 files ok).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.