GPU: a resolve names the format of the host texture, not the console's id #2325
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!2325
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2325"
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?
@denkencar-sketch on GitHub · 2026-11-25 10:42 UTC · original
denkencar-sketch:fix/list-002→main· +435 −6 · 2 files · 1 commits · openSummary
A resolve passed the console's format id (118-120) to the host verbatim, but the host has no such id: its textures are made in the PC formats
pc_formatgives.resolve_formatnow names the format of the host texture.Testing
Test
resolves_name_the_formats_of_the_host_texturesfails with the raw id and passes with this change. It tests the pure helperresolve_format; the call site is one line.cargo test --workspace --lockedpasses apart from 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 real MSAA depth-stencil resolve, or a run in the game.
AI-assisted.
Update: depth and stencil planes
Testing by steven-seagull27 on an RTX 5080 and WARP showed that formats 118 and 120 still failed to close the list with
E_INVALIDARGafter the first commit. Two commits were added:69b1659(steven-seagull27's commit): format 118's depth plane resolves inR24_UNORM_X8_TYPELESS, when both subresources select depth (each texture's own mip and array counts). Format 119 resolved correctly already.4b89b59: stencil planes (format 120, and 118's stencil plane) resolve throughResolveSubresourceRegionwith formatX24_TYPELESS_G8_UINTand an explicit mode, because the average resolve is rejected. The mode is the constantSTENCIL_RESOLVE_MODE=MAX. This is a chosen rule, not the console's: the console's rule for mixed samples is unknown, and the readback tests in this thread had equal samples inside each pixel.MAXkeeps a stencil mask at edge pixels (at worst a one-pixel halo), whereMINwould erode it. Where all samples agree, every mode gives the same value. A mixed-sample test pins the choice. If someone knows the console's rule, it is a one-line change.Note: the stencil resolve now always uses
ResolveSubresourceRegion, so on a device withoutID3D12GraphicsCommandList1it is skipped even for equal-sized textures.@steven-seagull27 on GitHub · 2026-11-25 11:07 UTC · original
I tested the production
list::resolvepath on an RTX 5080 (621.40) and Windows’ built-in WARP. Console format 119 now resolves all 16 depth pixels correctly on both adapters. On parent940d32fthe command list failed to close withE_INVALIDARG. Formats 118 and 120 still fail to close on PR head9f6943d.The fixture uses 4× MSAA source textures and single-sample destinations. It clears the source to two different depth/stencil values across a 4×4 pattern, pre-clears the destination to a third value, and reads the destination back after execution. Each row gave the same result on both adapters.
E_INVALIDARGE_INVALIDARGE_INVALIDARGE_INVALIDARGE_INVALIDARGI ran each case with equal-sized textures (
ResolveSubresource) and with a 4×4 source resolving into a 6×6 destination (ResolveSubresourceRegion). On the PR, format 119 produced the expected D24 values in the 4×4 region and preserved all 20 surrounding pixels. I recorded rejected command lists without submitting them and used a separate readback to confirm that the destination retained its clear value.For 118 on plane 0, the debug layer rejected
D24_UNORM_S8_UINT(45). Passing the depth-plane formatR24_UNORM_X8_TYPELESS(46) to the same runtime entry succeeded with the same backing formatR24G8_TYPELESS(44). That gives a concrete test for selecting the depth plane's resolve format.For 120 on plane 1, the debug layer rejected the average resolve of
X24_TYPELESS_G8_UINT(47). As separate native D3D12 controls,ResolveSubresourceRegionwith that same format and explicitMINorMAXeach copied all 16 stencil bytes correctly on both adapters. The samples within each pixel had equal values, so this fixture leaves the console's intended mixed-sample stencil rule open. Microsoft’s resolve-mode specification@steven-seagull27 on GitHub · 2026-11-25 11:34 UTC · original
I put the format-118 depth fix and regression tests in one commit directly on this PR head,
9f6943d. When the source and destination subresources both select depth, the resolve now usesR24_UNORM_X8_TYPELESS(46). The plane check uses each texture’s own mip and array counts. Cherry-pickable commit09f323bI ran the same two regression tests before and after the change on Windows 11 with the D3D12 debug layer. The tests call the guest command-list resolve with format 118, then check the depth values from a 4× MSAA source. Each number below is a pixel readback.
E_INVALIDARGE_INVALIDARGAll seven
list::tests passed on each adapter. Format 120’s stencil resolve mode is still open. Earlier MSAA controlsTo apply on your PR branch:
To rerun on Windows with hardware and then WARP:
With a device, both tests print their pixel counts after the assertions pass. The fixture uses synthetic textures.
@steven-seagull27 on GitHub · 2026-11-25 12:40 UTC · original
All four depth and stencil regression tests passed on
4b89b59on both the RTX 5080 (621.40) and built-in Windows WARP (10.0.26100.10068), with the D3D12 debug layer enabled. I ran each adapter in a separate process.I also recorded every stencil byte in the 8×8 triangle test, then repeated it with the resolve mode switched to
MINas a control. Formats 118 (stencil plane) and 120 returned identical grids on both adapters. Counts below are per format, per adapter.0x800x00MAX0x80MINcontrol0x00Only the eight edge pixels changed. The 28 fully covered pixels retained
0x80, and the 28 outside the triangle retained0x00. The two format-118 depth regressions also read back all 16 expected values on both adapters, and the clipped resolve preserved all 20 border pixels.This confirms the edge behavior of the PR’s chosen
MAXrule on native D3D12. The console’s rule for mixed stencil samples remains an open question.@Machad3x on GitHub · 2026-11-25 13:42 UTC · original
Result on RTX 3080 Ti, driver 621.24, Windows 11, with this PR cherry-picked onto a local stack of
main940d32fplus other open PRs (cargo test -p victory-gpu --lib):list::resolve_tests::format_118_resolves_its_stencil_plane_with_mixed_samplesandformat_120_...fail on the hardware adapter:stencil at (0, 0), left (read) 0, right (expected) 128. That is a diagonal pixel with mixed samples, soSTENCIL_RESOLVE_MODE= MAX did not keep the written value here.resolvetests pass.I did not check whether the result comes from the driver or from something else in my stack. A 5-minute in-game run with the PR showed no crash.
AI-assisted (Claude Code).
@Marvisak on GitHub · 2026-11-25 15:20 UTC · original · edited 2026-11-26 00:20 UTC
Automated triage for the maintainers.
Needs work. The core fix is right and needed.
resolveincrates/victory-gpu/src/list.rsstill passes the console's format id (118-120) to the host onmain, andresolve_formatnow maps it throughresource::pc_format, choosing the depth or stencil plane format. The rebase ontomain's 32-bit float mapping (118 => 20,119 => 21,120 => 22) looks right.One open point from the thread is not answered: Machad3x reported that both mixed-sample stencil tests (
format_118_resolves_its_stencil_plane_with_mixed_samples,format_120_...inlist/resolve_tests.rs) fail on an RTX 3080 Ti (read 0, expected 128 at a diagonal edge pixel). The MAX mode inSTENCIL_RESOLVE_MODEis a chosen rule, not the console's, so a test that pins it at mixed-sample pixels can fail on drivers that handle that mode differently, and contributors' test runs would go red. Please either find out why that adapter gives 0 there, or make the GPU tests check only pixels whose samples agree. The rule for mixed samples can stay documented as a choice.On your reply: the rebase and the use of
pc_format(119)/pc_format(120)look correct. The re-test is on AMD only. CI: passing.Generated by Claude Code
@denkencar-sketch on GitHub · 2026-11-25 23:41 UTC · original
Rebased onto current \main\ (\
842b0cb) and updatedesolve_format\ and
esolve_tests.rs\ for \main's \pc_format\ mapping (\118 => 20, \119 => 21, \120 => 22, using \pc_format(119)\ / \pc_format(120)\ directly instead of hardcoded D24/X24 constants). All 5 resolve tests (unit + depth + stencil GPU readbacks), \clippy, and \xtask policy\ pass on AMD Radeon 8060S.
@andrewpozdnakov7-jpg on GitHub · 2026-11-26 01:02 UTC · original
For the stencil-test review, I prepared 959add1 directly on
aed8fd34a201f9d2fde9b4a77e38b9bd4d8d1467. The triangle still produces the same staircase edge. The assertions check 28 fully covered pixels for0x80and 28 wholly clear pixels for0on each stencil plane. A mixed-sample diagonal is outside those asserted regions.The identical two fixtures fail to close the command list with
0x80070057on main63bcca43c6a00a758510398fa43096ce7e4f7df0. With the PR and this test commit, both close, submit, and pass readback checks in all six WARP runs per format. The full native WARP GPU suite passed with 251 tests and one ignored under both D3D12 debug settings. Strict GPU Clippy in both configurations and asset policy passed. This run used WARP.If you cherry-pick the test change, please retain the Git author. If folding it into another commit, please include
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.@steven-seagull27 on GitHub · 2026-11-26 01:19 UTC · original
I ran @andrewpozdnakov7-jpg’s test adjustment
959add1on top ofaed8fd3, with the D3D12 debug layer and a separate process for each adapter. All four GPU readbacks passed in three runs each on the RTX 5080 (621.40) and built-in WARP (10.0.26100.10068).For both formats 118 and 120, each stencil readback checked all 28 fully covered pixels (
0x80) and all 28 wholly clear pixels (0). The whole-plane and overlapping-region format-118 depth tests also passed. As a control, I applied the same fixtures alone to upstream63bcca4. All four GPU tests failed to close the command list withE_INVALIDARGon both adapters.This keeps a regression that catches the original format error while leaving the eight mixed-sample pixels available for a separate investigation on the 3080 Ti. The console’s mixed-sample stencil rule remains open.
AI-assisted with Codex. Synthetic depth and stencil readbacks.
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.