Repository navigation
fix(agc): store a storage image whose last block row runs past its allocation - #5030
Conversation
|
Windows test (MinGW GCC 15.2, Release, Windows 10, RTX 4080 SUPER). Built on main
Not tested: no game run. The batch was built once, not per PR; nothing failed, so no bisect was needed. AI-assisted (Claude Code). |
8a15b2b to
e6afbc9
Compare
|
Rebased onto Windows 11, WinLibs GCC 15.2.0 r7, Release, RTX 4080: AI-assisted: yes (Claude Code) |
|
The clipped bytes are not padding rows. They hold texels with y < height. With this change they are left unstored, without the "memory no longer registered" report and without the
What I ran (WSL2 Ubuntu, GCC 15.2, CI CMake configuration, Release, lavapipe): this PR merged onto main fdefd76, plus one extra execution test. The test uses the same compute store as
With A clip bounded only by the padding byte count cannot tell padding from lost data. One of these is needed:
The test would catch this if it checked every element with y < height, instead of only the bytes before pitch × height. AI-assisted: written with Claude Code; I checked the code paths and ran the test described above. |
…location A storage image whose surface runs past the end of its registered allocation had every write-back dropped as "memory no longer registered". Titles can size a single-level surface's allocation as pitch x height. A tiled mip's 64 KiB blocks are stored row-major, so that size ends inside the last block row, and the bytes after it are the tail of that row: they hold texels with y < height, which the GPU's own store writes into the next allocation. When the allocation ends inside the last block row and registered readable memory continues to the surface's end, the write-back now stores the whole surface, as the GPU does. Padding slots keep their bytes, since the store writes only bytes that changed. Epic Mickey: Rebrushed streams its lightmaps into an 8160x8160 BC3 pool (SW_64KB_S, 2048 block rows) through a 2040x2040 RGBA32UI alias written by compute. The game allocates 2040 rows, so all its write-backs were dropped and the walls sampled leftover memory as speckled noise. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
e6afbc9 to
6ad9372
Compare
|
@nikowolf123 you're right, thanks for the careful check. The blocks are row-major, so The test now checks every element: the split surface must match the fully registered one over the whole tiled size, with texels past pitch × height (768 here) and the padding slots keeping their sentinel. Windows, RTX 4080 and UHD 770,
Full ctest on the RTX 4080: 1110 of 1110. The description is updated; the in-game check with this version is still to do. AI-assisted: yes (Claude Code) |
|
In-game run of the new head 6ad9372: Epic Mickey: Rebrushed, Dark Beauty Castle. Linux, RX 7600 (RADV, Mesa 25.2.8), built on
I also checked the test on the RX 7600. A variant that checks every 8-byte slot (whole / split / short registration) fails on the previous clip at slot 0x1e000 (768 texels past the allocation) and passes with this logic. Full ctest: 1035/1035. AI-assisted (Claude Code). |
|
Checked the new overhang path in |

What
StorageTexture::writeBackLayersdrops a CPU-path write-back as "memory no longer registered" when no single registered readable range contains[base, base + guestBytes). A title can size the allocation of a single-level tiled surface as pitch × height, with the next allocation starting right after it. A tiled mip's 64 KiB blocks are stored row-major (TextureTiling.hpp), so that allocation ends inside the last block row. The bytes after it are the tail of that row: they hold texels with y < height, which the GPU's own store writes into the next allocation. In that case the whole write-back was dropped.With this change, the whole surface is stored as the GPU does when all of these hold:
tiledSize − pitch × height);Padding slots keep their bytes, since the store writes only bytes that changed. Everything else is dropped with the report and the
unregisteredDroppedcount, as before.Seen in Epic Mickey: Rebrushed (PPSA15657, UE 4.27):
Tested
agc_driver_storage_write_back_overhang:mainfeddf7f:Texture.cppfrommain: fails at byte 0x5 (the whole write-back is dropped);cteston the RTX 4080: 1110 of 1110.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