perf(agc): keep unchanged guest layers of a depth plane copy #2490
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2490"
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 oneandonlydean on 2026-10-09T23:10:15Z.
What
Follow-up to #425, as asked in its review.
DepthPlaneCopy(sampling a depth surface as a 2D array, a cube or its integer bits) keeps each slice it read from guest memory in its staging buffer, together with the write generation it was read at. The next use reads and detiles that slice again only when:UnchangedSince);Recorder::SnapshotWriteOverlaps); orWithout write watching, every use reads, as before.
#425 is merged, so this head is rebased onto
main1c5e6287and holds only its own commit. It applied without conflicts and the change is the same.Why
Every use read and detiled every slice no depth surface holds, even when nothing had written it.
The rule is the one a cached sampled snapshot already uses for a hit (
cachedTexture: collect, thenUnchangedSince), plus the pending-write check, so it is no looser than the existing texture path.Tested
Linux (CachyOS, GCC 16.2.1, Release with CI's configure flags and
ANYPS5_ENABLE_SPIRV_TOOLS=ON, full build andlibs), RTX 4090, NVIDIA 610.57.04.ctest -R "agc|shader"(--parallel 4,ANYPS5_REQUIRE_VULKAN=1): 462/462 on this head (af716047), 461/461 onmain1c5e6287.tools/check_conventions.py --base origin/mainandtools/check_test_registration.pypass.The seven
agc_driver_depth*tests underVK_LAYER_KHRONOS_validation: pass, no validation message.New
agc_driver_depth_plane_guest_layers. A 2-layer D32 array: layer 0 is a depth surface, layer 1 is in watched guest memory. Checks:MarkWritten) each make the next use read it again.It passes with the change (5 of 5 runs). On
main1c5e6287with only the test added it fails:sampling the depth planes again read the guest layer no depth surface holds although nothing wrote it.A 3D title we test with stops on
mainbefore its title scene without #4500, so it was measured onmain1c5e6287+ #4500, with this and #2491 together: frames per second in the title scene and in the menu after it.main1c5e6287+ #4500Without the two changes the title scene runs at 0.6 to 0.9 fps from its first frame on (74 frames in 90 s); with them the run goes on into the first level. One run each; caches warm for the second row. In the second row #4500's store-back also bumps the write serial (see #2491).
Not run on this head: the 2D title we test with (it ran on #2491's head, which contains this commit). Not tested on Windows or on AMD.
Checklist
main(1c5e6287, the merge of #425); no other open PR changesDepthPlaneCopy(#1368 samples depth arrays with its own storage, separately)NotImplemented_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)Imported from boykopovar/AnyPS5. Originally posted by Mouhand-Kaddo on 2026-10-10T10:04:54Z.
Additional platform validation on standalone PR head
5f0e7304189174bbfc033f37138b06ed15e4e77a:Windows: passed — Windows 11, supported WinLibs GCC 15.2.0 UCRT/POSIX/SEH r7; CMake 4.3.1 / Ninja.
Release /
BUILD_TESTING=ON: built the selected test targets; 2 CTest cases, 0 failures, 0 CTest skips.Tests:
agc_driver_graphics,agc_driver_depth_plane_guest_layers.Reproduce after building the test targets:
ctest --test-dir <build> --verbose --no-tests=error --timeout 30 -R "^agc_driver_(depth_plane_guest_layers|graphics)$".Vulkan: native AMD RX 6900 XT, driver 32.0.21045.5002.
Integration limitation: a local merge against main
948a526c2has source conflicts; these results validate the standalone PR head, not a resolved merge.