Repository navigation
fix(agc): take a storage image's writes to the stencil plane when a depth target binds - #12617
Conversation
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
@milescoviello thanks, the stencil route reads well: the exact plane match, the existing Two things before this goes to a frame-time gate:
|
|
@oneandonlydean thanks, both done in
Tested at AI-assisted: yes (Claude Code) |
123b274 to
f635514
Compare
✅ NVIDIA GPU test: passedPR head
Failing on main too (2, not counted against this PR)Validation IDs already present on main (4 IDs in 390 tests)Skipped (40)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
Reviewed at f635514. The rebase keeps the fix and the per-version guard as they were, and the test now sits after main's new cases without sharing planes. Thanks. The new base adds the stencil-plane coherence work (SyncStencilFromMemory / StoreStencilPlane, and storing a stale stencil plane before a retire), which writes the same stencil aspect as TakeStencilStorage. Two questions about how they meet:
|
|
An AMD RDNA 4 run of Windows 11 Pro 10.0.22631, AMD Radeon RX 9070 XT (
So on this card too, the new case fails without the change and passes with it. AI-assisted: yes (Claude Code) |
|
@oneandonlydean thanks. Both are fixed in
Two new cases in
They pass on this head, but they also pass with the old order and without the skip (control
Tests on
AI-assisted: yes (Claude Code) |
❌ NVIDIA GPU test: failedPR head
New validation errorsThis PR changes test files, so each test below was also run on main with only the PR's test changes applied; 0 there means the PR's other changes cause the error.
agc_driver_depth_clear_hle: new validation messagesUnstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (2, not counted against this PR)Validation IDs already present on main (4 IDs in 390 tests)Skipped (40)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
@TechLevelZero thanks. The new Cause. Tests, on
The merge preview against today's AI-assisted: yes (Claude Code) |
✅ NVIDIA GPU test: passedPR head
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (2, not counted against this PR)Validation IDs already present on main (4 IDs in 385 tests)Skipped (41)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
@TechLevelZero thanks for the rerun. That's the head with the device check ( AI-assisted: yes (Claude Code) |
…epth target binds A title that builds stencil through an 8-bit storage view of a depth target's stencil plane (Ghost of Tsushima, then tested by its lighting passes) left those writes on the storage image: the depth surface's stencil aspect kept older values. A one-sample depth target now copies a pending or live R8 storage image of its stencil plane, of its size, into its stencil aspect when that image's content version is newer than the one it last took. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…new and an already drawn depth surface Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d skip the scan while no 8-bit storage image was written A live storage image whose results were already stored may hold older stencil than the surface drew since, so only a pending image is taken. The scan on each bind now waits for a GPU write to an R8 storage image: StorageTexture counts them, and the surface skips the pending-list scan while the count is the one it last checked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e's memory sync, never from the surface's own mirror The take ran before SyncStencilFromMemory, so a bind that saw both a change in guest memory over the stencil plane and a newer pending R8 storage write reloaded the plane from memory over the write it had just taken. StoreStencilPlane also leaves the surface's own stencil in a pending R8 storage image at the stencil address, which the take would have copied back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s own device FindPending looks through every pending storage image, whatever device made it. agc_driver_depth_clear_hle creates more than one device over the same guest addresses, and the take copied another device's R8 storage into the plane (VUID-vkCmdCopyBuffer-commonparent). StorageTexture::Device() gives the take its device to compare. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Rebased onto
Checks at the head, Linux, NVIDIA 615.71.09:
AI-assisted: yes (Claude Code) |
c8059b5 to
e056b23
Compare
|
AMD RDNA 2 on RADV, which earlier runs here don't cover (NVIDIA on Linux and Windows, RDNA 4 on Windows). No regression, and the fix does what it says on this GPU. Setup: RX 6700 XT ( Commits: head
Control: At the merge, Same on both sides, unrelated to this PR: Not tested: Ghost of Tsushima or any other title, Windows, or the frame cost of the bind path. AI-assisted: yes |
|
@crastinator thanks, RDNA 2 on RADV was the gap. The control (main with only the new test failing 3 of 3) and the clean gate at AI-assisted: yes (Claude Code) |
✅ NVIDIA GPU test: passedPR head
Unstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (2, not counted against this PR)Validation IDs already present on main (4 IDs in 510 tests)Skipped (44)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
The red AI-assisted: yes (Claude Code) |
✅ AMD GPU test: passedPR head
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (12, not counted against this PR)Validation IDs already present on main (4 IDs in 513 tests)Skipped (53)ReproduceAutomated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
Both sides added depth cases on planes 11-14 of the shared test block; main's two RetiredSurfaceCase calls move to planes 19-22 and BlockBytes becomes 23 planes.
✅ NVIDIA GPU test: passedPR head
Unstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (3, not counted against this PR)Validation IDs already present on main (4 IDs in 525 tests)Skipped (49)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
✅ AMD GPU test: passedPR head
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (9, not counted against this PR)Validation IDs already present on main (4 IDs in 517 tests)Skipped (58)ReproduceAutomated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
What
A title can write a depth target's stencil through an 8-bit storage image over the target's stencil plane: a compute or pixel shader stores
R8_UINTtexels atstencilAddress, and later draws stencil-test against that depth target.DepthSurfacetakes a pending or live storage image's writes into its depth plane when it is created (TakeStorage), but not into its stencil plane. So the stencil test read whatever the stencil aspect held before: the clear, or an earlier frame's stencil.Ghost of Tsushima Director's Cut (PPSA02225 02.024.000) does this in its opening. I counted it with a local diagnostic: in a 910 s run, a one-sample D32S8 depth surface bound over a pending
R8_UINTstorage image of its whole stencil plane 400 times (265 at 3840x2160 and 133 at 1920x2160 planes, plus one other).This is a different path from #12210, which keeps a stencil plane coherent with guest memory written by buffer copies. Here the writes are a storage image's and are still on the GPU. The two merge cleanly together.
How
DepthSurface::TakeStencilStorageruns when a one-sample depth target with a stencil plane binds. It finds a pending (or live) storage image atstencilAddressof the plane's size, with the plane's extent and anR8_UINTorR8_UNORMformat, and copies it into the stencil aspect with the existingcopyPlane. It does this only when that image's content version is newer than the one it last took, so a draw with no new storage write between binds doesn't copy again. Multisampled targets and other storage shapes are left as before.Tested
The lines below name the head they ran on, or were run before the 11-02 rebase onto
maind2ce337078. For the rebased heade056b23d28, the area tests and the paired validation-layer comparison are in this comment.Head
f6355144d9: rebased ontomain673fa865f4after #10854 merged. Both PRs add cases toDepthSurfaceFromStorage.cpp. The block is now 15 planes; #10854's cases keep planes 8–10 and this PR's move from 9–12 to 11–14.StoreRowkeepsmain'slevelargument, through this PR's sharedStorehelper.^agc_driver_depth|^agc_driver_native_depth|^agc_driver_stencil|^agc_driver_storagepass 3 of 3.main673fa865f4and this head: both pass 2 of 2, with no missing-layer message, the 1 device checked on each side and noVUID-messages.Earlier, at
123b2741d9(after oneandonlydean's review: only pending storage images are taken, and the scan waits for a write to an 8-bit storage image):^agc_driver_depth|^agc_driver_native_depth|^agc_driver_stencil|^agc_driver_storagepass 3 of 3.main319621ba2eand this head: both pass 2 of 2, with no missing-layer message, the 1 device checked on each side and noVUID-messages.Earlier, at
bd1c1ffd90:Linux (Ubuntu 26.04.1, GCC 15.2), RTX 4070 Ti (NVIDIA 615.71.09), on
main319621ba2e:agc_driver_depth_surface_from_storage. AnR8_UINTstorage write of 1 over a D32S8 target's stencil plane, then a draw with stencilEQUAL 1:EQUAL 0on the cleared plane;main(dde951ef46) fails the first case:... tested EQUAL to the stored 1: 0 pixels passed, expected 32. At this head (bd1c1ffd90) the cases pass.^agc_driver_depth|^agc_driver_native_depth|^agc_driver_stencil(40 tests) pass 3 of 3.VK_LAYER_KHRONOS_validation1.4.363, LunarG SDK), onmain319621ba2eand at this head:VK_LAYER_PATH=<sdk>/layers VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest -R '^agc_driver_depth_surface_from_storage$|^agc_driver_depth_surface' -Vwas not found but was requested by env var VK_INSTANCE_LAYERS.agc_driver_depth_surface_from_storageon each side (agc_driver_depth_surface_last_writercreates none), with noVUID-messages.Windows 11 VM (GeForce GT 1030, WinLibs GCC 15.2, Release):
agc_driver_depth_surface_from_storageandagc_driver_depth_surface_last_writerpass 3 of 3 at this head and onmain319621ba2e.AMD RDNA 2 on RADV, by @crastinator (comment): RX 6700 XT, Mesa 26.2.5, head
e056b23d28merged ontomain98346b748c.tools/vulkan_validation_gate.pyover^agc_driver_depth|^agc_driver_native_depth|^agc_driver_stencil|^agc_driver_storage(57 tests, 3 iterations per side) passes on both sides with noVUID-messages, andmainwith only this PR's test fails the new case 3 of 3.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code