AGC: a small tiled storage image on a 64 KiB base is not stored before a label after its write-back went into a unit shadow #11481
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Imported from boykopovar/AnyPS5. Originally posted by panicDa3m0n on 2026-10-26T16:39:50Z.
What happens
A small tiled storage image whose base is 64 KiB-aligned keeps its results only in the import's unit shadow after a write-back for a device reader (
PublishScope::None). The store before the next label no longer sees it, so a direct CPU load after the label reads the import's old bytes:small tiled shadow label: 0 guest bytes read by the CPU after a flush for storage image creation and the store before a label hold the image's value, expected 4096.Title, test or build step
A test case added to
agc_driver_recorder_tests(--small-tiled-shadow-label-only, code below). It is a synthetic test on the code path: we have not seen it as a wrong image in a title.AnyPS5 commit
main035ac96edd, nothing on top.System
Windows 11 (10.0.26200), NVIDIA GeForce RTX 4070 Ti SUPER (616.64), WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release.
Steps to reproduce
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp, and its option tomain().agc_driver_recorder_testsand runAPS5_PIN_WAIT_MS=2000 build/tests/agc_driver_recorder_tests.exe --small-tiled-shadow-label-only. It exits with 1.What the test does:
AllocateWatched, registered withGuestAllocations::Mutation::Add, host-imported (HostImportFor) and watched (Watched);kR64KBXat offset 0x40000, a 64 KiB-aligned base, filled on the GPU withvkCmdCopyBufferToImageandMarkDirty;StorageTexture::FlushPending(…, "storage image creation", PublishScope::None), then a print ofAnyShadowedOverlapsover the image;StorageTexture::StoreReadbackBeforeLabel("readback before label");The same steps pass on
mainwith a 64x64kLinearimage at offset 0, or a 32x32kStandard4KBimage at 0x21000: their write-back does not go into the shadow.The test
In
main(), next to the other--…-onlyoptions:Log
The test's lines. The environment lines before them (
[time], the host CPU line,[write-watch]and a secondVulkan device) are left out.What was checked
Where it goes wrong, reading
main035ac96edd:blockUnits(Graphics/src/Texture.cpp:1442) holds for a tiled image at a 64 KiB-aligned base. Its write-back goes throughwriteBackWindowsinto the import's unit shadow.PublishScope::Nonetakes the image off the pending list and leaves its bytes in the shadow. These write-backs are"storage image creation"inShaderResources.cpp:1242andDepthSurface.cpp:1429, and"storage refresh"inTexture.cpp:2193.StoreReadbackBeforeLabel(Texture.cpp:4540) walks only the pending images;WriteLabelOnGpupublishes the shadow only over the label's own bytes.This is the class
14fd9853db("also store small tiled images before a label") meant to keep stored before a label. Linear images and small tiled images off a 64 KiB base are correct onmain, because their write-back does not go into the shadow.The natural fix looks like the criterion the store before a label already uses (at most
SmallStoreBytes), applied to the block write-back inwriteBackWindowstoo, so that these images stay out of the shadow. Having the label publish the shadowed units of this class would be another way. If the first direction is the right one, I can take it.@alfalfa-star, since
14fd9853dbis yours: does this match what that change meant to cover?AI-assisted: yes