Repository navigation
fix(agc): look up a merged color target again when a recovery evicted its resident image - #13178
Conversation
… its resident image A texture cache release during a draw (the recovery of an out-of-memory image allocation) evicts every clean storage image, including the resident image a merged color target was just bound to. The draw's resources then bind the surface's new image, and the draw stopped with "the partial write of a packed color target does not store into the target's resident image". The target is now looked up again so it renders into the image the resources store into. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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.
|
|
Checked the overlap report by hand, as in the Overlap section of the description: each of the 27 pull requests listed here gives the same conflicts in AI-assisted: yes (Claude Code) |
|
An AMD RDNA 4 run on Windows, since the description lists an NVIDIA RTX 4070 SUPER on Linux only. Windows 11 Pro 10.0.22631, AMD Radeon RX 9070 XT (
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 (3, not counted against this PR)Validation IDs already present on main (5 IDs in 484 tests)Skipped (45)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. |
|
Windows GPU run of head Windows 11 Enterprise 10.0.22621, Ryzen 9 5950X, Radeon RX 6700 XT with AMD proprietary driver 26.10.1 (Vulkan 1.4.315), WinLibs GCC 15.2.0 UCRT r7, Ninja, Release,
AI-assisted: yes (Claude Code). |
|
The overlap report now lists 30 pull requests; 8 are new since my earlier check (13021, 13023, 7085, 9533, 9717, 9742, 9852, 9875). Merging each into AI-assisted: yes (Claude Code) |
|
A lavapipe run, since the Linux CI job was skipped for this PR and the thread has NVIDIA and AMD results only. Head The control stops with AI-assisted: yes |
What
A draw whose color target merges in the pixel shader (a 4_4_4_4 partial write, or an unclamped normalized blend) stopped with
the partial write of a packed color target does not store into the target's resident imagewhen the texture caches were released in the middle of the draw. PPSA26344 (02.002.000) stopped on it at 528 s in a run with #12684 (comment), right after twovkAllocateMemory storage texture recovered ... initialResult=-2lines.How it happens:
prepareDrawlooks up each target's resident image first, then resolves the draw's resources, which bind the merged target's surface as a storage image through the storage image cache.BufferPool::AllocateMemoryreleases the texture caches. The storage half ofReleaseTextureCachesevicts every clean image, including one the draw holds; it only leaves it out of the bytes it counts as freed. In a draw with two merged targets, creating MRT1's image can evict MRT0's.The change: after the resources are resolved, a merged target whose resident image the resources do not store into is looked up again (
CachedStorageSurface, orCachedStorageLayersfor an array slice) throughrefreshResidentTarget, and its attachment view is replaced. That finds the image the resources bound. The existing check stays, so a draw that still disagrees stops as before.Draw.cpp+12/−2, the test +61/−4.Tested
CachyOS Linux (kernel 7.3.0-4-cachyos), GCC 16.2.1, Release, NVIDIA GeForce RTX 4070 SUPER (615.78.08). Head
5fda10d3d4onmain422f96b3a9.New case in
agc_driver_unclamped_normalized_blend. Two 8_8 UNORM targets blend in one draw, as in the title. MRT0's resident image is created before the draw. During the draw, MRT1's image creation callsReleaseTextureCaches(..., true), as the recovery of an out-of-memory image allocation does at that point, and the test checks that the release evicted storage images. Both targets are then checked per pixel against the CPU reference.main'sDraw.cppand the same test it stops with the title's message.vkCreateImagewrapper in a testContextrather than by failingvkAllocateMemory. A failing allocation needs a secondBufferPool, and the pipeline store treats a context with another pool as a new device, so it abandoned the device's cached pipelines and the validation layer reported them leaked atvkDestroyDevice.Focused run.
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build-tests -V -R '^agc_driver_(unclamped_normalized_blend|packed_unorm4444.*|linear_target.*|dcc_keys.*|partially_resident.*|uint8x4.*|stencil.*|multisample.*|multisampled.*|pass_.*|sample_order.*|draw.*)$', the draw-path tests:mainVUID-lineswas not found but was requested by env var VK_INSTANCE_LAYERSagc_driver_stencil_ref_exportandagc_driver_sample_order_grid_referenceskip on this device in both runs. Themaincolumn ranmain'sDraw.cppand test file in the same build tree.Full suite. All 2955 pass under the same environment; 34 of them skip on this machine, most of them VideoOut flip tests.
PPSA26344. Not run on this head. The stop was seen once, in the run with perf(agc): let the sampled texture cache grow into host memory while a frame's textures don't fit #12684, which put the storage image cache under more pressure.
Overlap:
tools/pr_overlap.py --branchlists #13145, #13146, #13147, #13148 and #13149 inUnclampedNormalizedBlend.cpp; each of them sets the files #12916 changed back to their contents before #12916. The 28 pull requests it could not compare give the same conflicts inDraw.cppand the test with this branch as withmain. The second lookup goes through the cache directly instead of moving the resident lookup into a function, which would have conflicted with #7310 and #11825.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