GPU: clip MSAA resolves to the selected mip dimensions #2306

Closed
andrewpozdnakov7-jpg wants to merge 1 commit from upstream-pr/2308 into main
andrewpozdnakov7-jpg commented 2026-11-25 10:15:47 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-25T10:15:47Z.


The host resolve chose the whole-subresource operation whenever the two base texture sizes matched. A 16×16 multisampled source and a 16×16 destination still have different subresource sizes when the destination is mip 1 (8×8). The region path also clipped to the base sizes instead of the chosen mips.

Use the mip dimensions to decide whether a region is needed and to bound it. Recover the mip index from the subresource number so array slices and format planes start at mip zero. The previous whole resolve remains available when both the base and selected dimensions match.

  • The geometry regression on 940d32f selected a whole resolve for mip 1. On c922080 it selects an 8×8 region and clips correctly for an array slice.
  • A synthetic WARP run cleared a 16×16 MSAA source with a contrasting 8×8 corner, resolved it into the 8×8 mip of a 32×32 target, and read back all 64 texels. Both builds produced the expected color on this WARP adapter. The regression catches the command geometry difference.
  • With app-local Agility 1.620.2 and WARP 1.0.22, all 147 victory-gpu tests that ran passed, plus the temporary runtime identity check. Two tests were ignored. Strict Clippy with and without diagnostics and staged policy passed.

D3D12 resolve rules · Coordination claim

AI-assisted with Codex. Synthetic data only.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6602169715 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2308). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-25T10:15:47Z. --- The host resolve chose the whole-subresource operation whenever the two base texture sizes matched. A 16×16 multisampled source and a 16×16 destination still have different subresource sizes when the destination is mip 1 (8×8). The region path also clipped to the base sizes instead of the chosen mips. Use the mip dimensions to decide whether a region is needed and to bound it. Recover the mip index from the subresource number so array slices and format planes start at mip zero. The previous whole resolve remains available when both the base and selected dimensions match. - The geometry regression on `940d32f` selected a whole resolve for mip 1. On `c922080` it selects an 8×8 region and clips correctly for an array slice. - A synthetic WARP run cleared a 16×16 MSAA source with a contrasting 8×8 corner, resolved it into the 8×8 mip of a 32×32 target, and read back all 64 texels. Both builds produced the expected color on this WARP adapter. The regression catches the command geometry difference. - With app-local Agility 1.620.2 and WARP 1.0.22, all 147 `victory-gpu` tests that ran passed, plus the temporary runtime identity check. Two tests were ignored. Strict Clippy with and without diagnostics and staged policy passed. [D3D12 resolve rules](https://microsoft.github.io/DirectX-Specs/d3d/ProgrammableSamplePositions.html#resolvesubresourceregion) · [Coordination claim](https://github.com/Marvisak/VIctory/issues/1633#issuecomment-7159196402) AI-assisted with Codex. Synthetic data only.
upstream-sync closed this pull request 2026-11-25 11:04:44 +00:00
catminou4 commented 2026-11-25 11:04:45 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T10:19:21Z.

Review: COMMENTED


MSAA resolves clipped to the selected mip dimensions (resolve_region). 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.

<!-- greyfinch-sync:Marvisak/VIctory:review:6055714502 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2308#pullrequestreview-6055714502). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T10:19:21Z. **Review:** COMMENTED --- MSAA resolves clipped to the selected mip dimensions (resolve_region). 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.
DenRakEiw commented 2026-11-25 11:04:45 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T10:21:54Z.

Review: APPROVED


Verified against origin/main (940d32f) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP:

  • Computing per-subresource mip extents (subresource % MipLevels.max(1)) in resolve_region cleanly clips MSAA resolves to the selected destination mip dimensions instead of always using mip 0.
  • cargo test -p victory-gpu msaa_resolve_region: 1/1 passed on RTX 5090, 1/1 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).

<!-- greyfinch-sync:Marvisak/VIctory:review:6055749906 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2308#pullrequestreview-6055749906). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-25T10:21:54Z. **Review:** APPROVED --- Verified against `origin/main` (`940d32f`) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP: - Computing per-subresource mip extents (`subresource % MipLevels.max(1)`) in `resolve_region` cleanly clips MSAA resolves to the selected destination mip dimensions instead of always using mip 0. - `cargo test -p victory-gpu msaa_resolve_region`: 1/1 passed on RTX 5090, 1/1 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).
andrewpozdnakov7-jpg commented 2026-11-25 11:05:31 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-25T10:41:12Z.


I found the earlier #652 while checking the resolve changes against the open queue. It already uses the selected mip extents for this decision and has a synthetic readback that reproduces the wrong pixels on RTX 5090. My WARP readback matched on both revisions, and my geometry check covers cases already exercised there. Closing this duplicate in favor of #652. The fork commit c922080 remains available for reference.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7160035884 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2308#issuecomment-7160035884). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-25T10:41:12Z. --- I found the earlier #652 while checking the resolve changes against the open queue. It already uses the selected mip extents for this decision and has a synthetic readback that reproduces the wrong pixels on RTX 5090. My WARP readback matched on both revisions, and my geometry check covers cases already exercised there. Closing this duplicate in favor of #652. The fork commit `c922080` remains available for reference.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!2306
No description provided.