mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-18 23:07:07 -05:00
The stage-A pre-sync of a dispatch listed only the surfaces that stage B reads on the CPU. The DCC keys of an image that a recorded kernel writes were not in the list, so stage B waited for that kernel in WaitForKeyWriters with the GPU mutex held and every other worker queued behind the wait. At the Minecraft Dungeons II title the pre-sync fired once in 296,000 dispatch checks while WaitForKeyWriters synchronized 400 times per 10 s. PresyncSurfaces now also returns the key range of every image binding (PresyncSurface::dccKeys). presync waits for a key range only while recorded work writes it, the key-store memo does not already give its value (DccKeyWritersPending) and, under the mutex it takes for a moment anyway, the pending stores do not give the keys either (DccKeyWriterNeedsSync, the test WaitForKeyWriters makes before it synchronizes). Which keys the dispatch reads, and when, is unchanged: the locked lookup runs as before and finds nothing pending. APS5_NO_DCC_PRESYNC=1 leaves the key ranges out. The [presync] line counts key ranges checked, pre-syncs that only the keys required and the outcomes of WaitForKeyWriters. The test agc_driver_dcc_key_presync covers a kernel that writes the keys, a recorded fill of the keys and nothing pending, and skips with the reasons check_skips.py expects when the device has no timeline semaphores or no host import.