perf(agc): record a DMA copy of up to 64 KiB on the GPU when the GPU still stores into its source #5480
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5480"
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 Nesyth on 2026-10-13T20:53:52Z.
What
A
DMA_DATAcopy of 64 KiB or less is read on the CPU. When the GPU is still writing its source, that read submits the open batch and waits for it, so queue 0 stalls on every such copy. In Ready or Not (PPSA18605) that is about 90 waits every 10 seconds, roughly 33 ms per frame. Larger copies already go throughCopyBufferon the GPU and don't have this problem.This change sends the small ones down the same path when their source still has pending GPU stores. In RoN the time spent on these packets drops from about 37 ms to about 5 ms per frame and the waits go away entirely. On
mainthe frame rate change stays within run-to-run variation, because a per-draw buffer copy still makes frames long there. On my bring-up build, where that copy is gone, the frame rate goes up 10%.GpuMutexwhether its source may still have pending stores: the recorder's pending-write snapshot, pending storage images, unit shadows, and the worker's queued labels. Only then does it takeGpuMutex, record the deferred labels, confirm the pending stores, and ask a newVulkanDevice::GpuCopyPossiblewhetherCopyBuffertakes a GPU path without waiting: no completion store still to land over either range (copyWaitsOnCompletions, the ruleCopyBuffersyncs on), and either an alias that passes the image copy's own refusals (StorageTexture::CopyRefusal, whichCopyFromnow returns) or host imports over both ranges. Only then does the copy go toCopyBuffer; any result other than a GPU path throws, and the source is never read on the CPU.GpuMutexonce, as onmain), copies that would wait for a completion store, ranges that aren't imported, overlapping ranges, GDS, immediate data and fills.CopyBuffergets no CPU size here. For every aliased copy, the large ones included, a refusal afterCopyRefusalpassed, or a failure to make the destination's image, now throws instead of falling back to a transfer.WAIT_REG_MEMon the destination waits on memory instead, as it does after a big copy. In RoN, queue 0'sWAIT_REG_MEMtime stays at about 0.1 ms per present with and without the change.[sync]counter,copiesBehindPendingSources, so the effect shows up in the logs.Tested
Windows 11 Pro 10.0.22631, Ryzen 7 7800X3D, RX 7900 XTX, WinLibs GCC 15.2.0, Release, on
maina050f856f; the RoN runs below are onmain0aa4cb1c2.testSmallCopyBehindPendingSourceintests/Submit.cpp: a 4 KiB copy from a buffer the GPU is still writing has to land the right bytes and go through the GPU; a copy from a settled buffer, and a copy into memory that isn't imported, have to keep the old path without callingCopyBuffer. It fails if the GPU path orGpuCopyPossibleis reverted.agc_driver_small_copy_syncruns it withAPS5_COPY_SYNC=1, where every pending write counts as one with a completion store, and requires the first copy to stay off the GPU path; it fails without thecopyWaitsOnCompletionscheck. The check beforeGpuMutexchanges no outcome, only how often the lock is taken, so no test covers it.ctest -R "^agc_"passes 541 of 547 tests with 4 skips;agc_driver_layered_volume_vertex_no_gplandagc_driver_recorderfail, as they do onmaina050f856fon this GPU.main0aa4cb1c2and 62fccc881 (APS5_TRACE_SECONDS=125:30), and one pair ofmaina050f856fand this head (160:10, no frame dumps, nothing dropped).On
main0aa4cb1c2, all libraries built from it and only the driver swapped. In all four runsmaincopied a 768 KiB buffer on most draws (the case #5372 fixes), so frames are long and the same saving is a smaller share:DMA_DATAtime per frameDMA_DATAper 10 sOn my bring-up build (
main0214069e3plus other local changes, including a join for that buffer):DMA_DATAtime per frameDMA_DATAper 10 sThe GPU stays busy 100-107 ms per frame in every run, so the scene remains CPU-bound.
Discussion #5436 reports the same queue-0 cost at 12.5 ms per frame in Sword of the Sea; this change was not run there.
Linux: not run.
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)Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T23:05:59Z.
Please add the
aps5-summary.jsonllines and traces of main and of this change from the same Ready or Not scene, as the performance report form describes. On main the FPS of the two builds overlap (1.93/2.07 against 2.17/2.00), so theDMA_DATAtime is the only clear gain so far.CopyBufferfinds out that a range isn't imported only after it has synced the source and flushed the pending images (VulkanDevice.cpp:2258-2295), and the packet then takes the CPU path anyway (PacketMemory.cpp:115-128). Please decide that before calling it, so each copy takes one path.Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-14T00:53:12Z.
Review: COMMENTED
Adding to the review above, two costs that the profile table doesn't show:
DMA_DATAof up to 64 KiB now takesGpuMutex, including the settled ones that end up on the old path:copyBehindPendingSourcelocks it beforeStoresPendingOverdecides anything. Small copies are frequent, and other queues' dispatches, draws andPresentcontend on that lock. The pending-store check would ideally run withoutGpuMutex(or under the recorder's own lock) and takeGpuMutexonly when the copy is actually recorded. Together with the import check requested above, the common settled case should cost no more than it does onmain.WAIT_REG_MEMon the destination now polls memory, which needs the transfer to complete. In RoN, the per-frame time of theWAIT_REG_MEMpackets (opcode0x3c) and the number of drains it triggers, before and after, would show whether the 32 ms leftDMA_DATAor moved into the wait. "queue 0 per frame" falls, which is encouraging, but onmainthe two runs overlap.Minor: the packet is decoded twice when the GPU path is not taken (
DecodeMemoryCopyin the lambda, thenResolveStore).The approach itself, recording a small copy behind its source's pending GPU stores instead of syncing the batch to read it on the CPU, is the right direction.
Imported from boykopovar/AnyPS5. Originally posted by Nesyth on 2026-10-14T18:51:04Z.
Thanks to both of you. All points are addressed in e1615b3e2, rebased onto
main4ae78dc13.One path per copy (@oneandonlydean): the copy now asks
VulkanDevice::GpuCopyPossiblefirst. It does the same lookupsCopyBuffermakes for its GPU paths (host imports over both ranges, or a live storage image at the source to alias), without syncing or flushing anything. Only when it says yes does the copy go toCopyBuffer; otherwise it takesResolveStoredirectly.testSmallCopyBehindPendingSourcehas a new case that copies into memory that isn't imported and requires it to skipCopyBuffer. It fails with the check removed: "a small copy into memory that is not imported went through the GPU copy before its CPU path". Two rare cases can still take both paths: the sync retires an import between the check and the copy, or the check passes only on the alias andCopyFromthen refuses the image copy.GpuMutex(@CnRJay): a copy takesGpuMutexonly when its source may still have pending stores. It checks that without the lock, against what the flush hook would find for a CPU read: the recorder's pending-write snapshot (Recorder::SnapshotWriteOverlaps), pending storage images, unit shadows, and the labels this worker has queued. A settled copy goes straight to the old path and takes the lock once, as onmain. The copy is decoded once and the result is shared with the large-copy path;ResolveStorestill reads its own header fields, as onmain.Where the wait went (@CnRJay): not into
WAIT_REG_MEM. In the four traces below, queue 0'sDriver.Packet.memory_wait(WAIT_REG_MEMand its 64-bit form) takes 0.08 and 0.10 ms per present onmainand 0.06 and 0.06 with the change, about one wait per present. In the profiled runs from the description, the device drained 2 and 3 times onmainand once in each run with the change, over three windows each, every time onDMA_DATAand never onWAIT_REG_MEM. The largememory_waitin the summary lines is the compute queue's worker (0x28), which waits for queue 0. What does grow is queue 0'sflush_between_packets, by about 2 ms per present (6.0 to 7.8 in the first pair, 5.0 to 7.0 in the second), against the 31-33 ms thatprepare_memorydrops.Traces: two pairs from the same Ready or Not scene on the same machine in one session,
main0aa4cb1c2and 62fccc881,APS5_TRACE_SECONDS=125:30, warm caches, noAPS5_PROFILE_*switch. 62fccc881 is the head before this rebase and the lock change; its GPU path is the same. The second pair ran in the reverse order. All four runs also dumped every fifth frame and redirected the log, which the form asks to avoid; I can redo them on the new head without that if you'd rather.aps5-trace-62fccc881ab7-14268.json.gz
aps5-trace-62fccc881ab7-27900.json.gz
aps5-trace-0aa4cb1c2f2f-20600.json.gz
aps5-trace-0aa4cb1c2f2f-25108.json.gz
The per-present numbers above and here cover the part each trace recorded (queue 0's buffer filled after 12-16 s in every run). What holds in both pairs is the copy cost: queue 0's
Driver.Packet.prepare_memorydrops from 37.2 to 3.8 ms per present in the first pair and from 36.1 to 5.4 in the second. The frame rate does not: the change presents 64 frames against 52 in the first pair and 56 against 61 in the second, where the change run rendered with the colour cast #5321 fixes and themainrun did not. That cast comes and goes between launches with either driver here. Onmainthe per-draw buffer copy #5372 fixes keeps frames at about 400 ms, which hides a saving of about 30 ms per frame; on my bring-up build without that copy it showed as +10%.Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-14T19:11:44Z.
Thanks, that answers both. A settled copy now costs three range checks under their own small locks instead of the GPU mutex. The traces also show the wait didn't move into
WAIT_REG_MEM.flush_between_packetsgrows by about 2 ms whileprepare_memorydrops by 31–33 ms, a clear net gain.The four traces are from 62fccc881, before the lock change. All four have
trace_dropped: trueand were taken with frame dumps on. One pair on the current head withoutAPS5_DUMP_FRAMES*would let the maintainers check numbers from the code they merge. That's the only thing I'd still ask for.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T20:31:47Z.
Thanks. The two cases you list still try the GPU copy and then fall back to the CPU copy. Please make each one choose its path before copying, or throw:
VulkanDevice.cpp:2381-2394, then:2416-2418): whetherCopyBufferwill sync is a pure query (PendingWriteOverlaps && completionStoreOverlapson either range). That copy waits for the batch on either path, soGpuCopyPossible(VulkanDevice.cpp:2282) should return false when it holds, and the copy takesResolveStorefrom the start.AliasCopyfails (VulkanDevice.cpp:2264against:2244andTexture.cpp:4039-4062):AliasCopyPossiblechecks onlyFindLiveand the shape.CopyFromalso refuses on DCC keys, a released or uncached image, a destination that isn't imported, and no recorder. All of these can be checked up front, so please make the check andAliasCopyuse the same predicate.With both checks exact,
PacketMemory.cpp:131should throwstd::runtime_errorwhenCopyBufferreturns anything other than path 1 or 3, instead of returning false intoResolveStore. That leaves only aCachedStorageSurfacefailure, which isn't understood, and it should throw rather than be caught.Imported from boykopovar/AnyPS5. Originally posted by Nesyth on 2026-10-14T22:03:42Z.
Thanks, both checks are exact in 7a17fb158, rebased onto
maina050f856f:CopyBuffer's wait rule is one function now,copyWaitsOnCompletions(a pending write over the range and a completion store still to land on it).CopyBuffersyncs on it, andGpuCopyPossiblereturns false when it holds for either range, so such a copy takesResolveStorefrom the start.agc_driver_small_copy_syncruns the small-copy test withAPS5_COPY_SYNC=1, which makes every pending write count as one with a completion store, and requires the copy to stay off the GPU path; it fails with the check removed.StorageTexture::CopyRefusalholdsCopyFrom's refusals (shape, DCC keys, a released or uncached image, a destination that isn't imported, no recorder), andCopyFromreturns its answer.AliasCopyandGpuCopyPossibleboth go through onePlanAlias, which finds the two images and asksCopyRefusal; when the destination image is still to be made, its import is checked at the destination address.CopyBufferreturns a path other than 1 or 3 afterGpuCopyPossibleaccepted the copy,AliasCopythrows whenCopyFromrefuses afterCopyRefusalpassed, and aCachedStorageSurfacefailure now propagates instead of being caught. That last one applies to every aliased copy, the large ones included.agc_driver,agc_driver_small_copy_syncand the related copy tests pass.ctest -R "^agc_"passes 541 of 547 with 4 skips; the two failures,agc_driver_layered_volume_vertex_no_gplandagc_driver_recorder, fail the same way onmaina050f856fon this GPU, and no test hit either new throw.Traces on this head (@CnRJay):
maina050f856fand 7a17fb158, same scene,APS5_TRACE_SECONDS=160:10, no frame dumps, log not redirected,trace_droppedfalse in both:aps5-trace-a050f856f14e-23188.json.gz
aps5-trace-7a17fb1588b2-24776.json.gz
Today's
mainruns this scene at about 0.68 FPS, against about 2 FPS on0aa4cb1c2for the pairs above, so a 10 s window holds 7 presents. Over the whole window queue 0'sprepare_memorygoes from 12.0 to 8.5 ms per present,WAIT_REG_MEMstays at 0, andflush_between_packetsgoes from 4.0 to 4.4 ms. The title reached the scene with this head's throws in place, and none fired.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:07:48Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppL4692-4707core/libs/prx/libSceAgcDriver/tests/Submit.cppL977Some 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.
core/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/include/Texture.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Texture.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Texture.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/include/Texture.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/include/Texture.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Texture.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Texture.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Texture.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Texture.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketMemory.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Texture.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Texture.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Texture.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/include/Texture.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/include/Texture.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Texture.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Synchronization/SynchronizationStatistics.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Synchronization/SynchronizationStatistics.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Texture.hppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/include/Texture.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/include/Texture.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Texture.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppImported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-15T18:20:49Z.
Thanks, that covers both of my points. A settled copy now skips the GPU mutex, each path is chosen exactly before copying, and the traces are on the current head with nothing dropped.
prepare_memorygoes from 12.0 to 8.5 ms per present, andWAIT_REG_MEMstays at 0. With 7 presents per window the frame-time percentiles can't separate the builds, but nothing points to a regression. Nothing more from me.Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-15T23:07:53Z.
Review: COMMENTED
A Linux and NVIDIA run, since the description lists only Windows on an RX 7900 XTX.
Machine: NVIDIA GeForce RTX 3070, driver 595.99.02, Vulkan 1.4.329, Ubuntu 26.04 (kernel 7.0.0-38), i7-8700. GCC 15.2, Release,
BUILD_TESTING=ON,ANYPS5_GPU="NVIDIA GeForce RTX 3070". Head63492cd8fmerged ontomain5d9dcc42d, no conflicts.GPUs tested: NVIDIA GeForce RTX 3070 (595.99.02), Linux
agc_driver(withtestSmallCopyBehindPendingSource) andagc_driver_small_copy_syncpass 3/3. The first requires the copy to be counted incopiesBehindPendingSources, so the GPU path is taken on this driver, not only on RADV/Windows AMD.Fault checks on this machine (the test does not build against
main's sources, so I used mutations of the PR):copyBehindPendingSource()never taken:agc_driverfails 3/3 witha small copy whose source the GPU still stores into was not recorded on the GPU.copyWaitsOnCompletionschecks removed fromGpuCopyPossible:agc_driver_small_copy_syncfails 3/3 witha small copy that has to wait for a completion store over its source went through the GPU copy.Both pass again with the PR's code restored.
ctest -R "^agc" -E "agc_display_buffer_dcc|agc_driver_flip|agc_driver_lds_atomics64" -j1 --timeout 60: 592/594 pass (one more test thanmain, the newagc_driver_small_copy_sync). That matches unchangedmainon this machine:agc_driver_stencil_ref_exportskipped,agc_driver_store_over_untrackedfails as onmain(#6385). Of the two failures the description lists for the 7900 XTX,agc_driver_layered_volume_vertex_no_gplpasses here; there is noagc_driver_recordertest in this Linux build.I did not run a title.
Written with AI assistance (Claude Code). I ran the tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T00:41:49Z.
@CnRJay's and @jotitadev's runs cover both 10-14 points: the small copy behind a pending source is recorded on the GPU on the RTX 3070, and
agc_driver_small_copy_syncfails 3/3 when thecopyWaitsOnCompletionschecks are removed. It conflicts with main now inVulkanDevice.hpp(two independent declaration blocks, keep both). @Nesyth, please rebase; #6249's byte-coverage guard stays with #6249.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T02:04:36Z.
Rebased onto current main (now
e04111bb5). The only conflict was two independent declaration blocks inVulkanDevice.hpp, both kept; the PR's own lines are unchanged (9 files, +163/-55). Local build plus thedma|copytests: 8/8 passed. Full CI is running on the new head.Overlap with #6249: #6249's
ImageCoversGuestBytesguard and this PR'sPlanAliasrefactor overlap. Whichever lands second moves the guard intoPlanAliasafter the source lookup as aplan.refusal, soAliasCopyPossiblerefuses the same copiesAliasCopydoes.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T02:33:21Z.
CI run 38993484777 on head
e04111bb5: Linux is green. On Windows, the newagc_driver_small_copy_syncfails in 0.04 s. The runner has no Vulkan device, so the test prints "skipped, no usable Vulkan device" and returnsVulkanTestSkipped(77). Its entry incore/libs/prx/libSceAgcDriver/CMakeLists.txtdoesn't setSKIP_RETURN_CODE 77the way the other Vulkan-backedagc_driver_*tests do, so ctest counts the skip as a failure. Suggested fix: addSKIP_RETURN_CODE 77to thatset_tests_propertiesline. Happy to push the one-liner here if you prefer. (Theguest_shader_linktimeout in the same run is the known Windows exit hang, #6791.)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T09:31:46Z.
This pull request is labeled
perf, so it needs the summary line of a capture onmainand one with the change, from the same title, scene and machine, as the Performance report form asks. Please paste bothaps5-summary.jsonllines, attach the two traces and add the output oftools/trace_digest.py.