AnyPS5/core/libs/prx/libSceAgcDriver/Graphics/shaders
Dean Galvin 2596f8c0ad perf(agc): record occlusion counter dumps on the GPU
Every ZPASS_DONE counter dump drained the device so the CPU could add up
the occlusion queries of the finished batches and store the running total.
PPSA21564 dumps around each occlusion-tested pass: about 1.5k drains per
10 s at its title screen, and in a level's early passes four drains a frame
that took 5.6 s of every 10 s of the graphics worker.

The running total now lives in a small buffer the GPU updates in batch
order. A batch still ends its occlusion query at submit; a query that saw
draws is remembered, and its pool is kept alive until it is folded. A dump
ends the open batch's query, copies the remembered results next to the
total, adds them with a one-thread compute shader that also stores the 16
DB counters into the dump's host import, and begins a fresh query for the
rest of the batch. The dump is ordered with the work around it like any
other GPU store, noted as a pending write and stamped. More than 64
remembered results are folded at a submit. Query pools are recycled.

A dump into memory the GPU cannot see, under a pending copied write-back
or over a label the CPU stores at a completion falls back to the drain,
which settles the remembered results on the CPU. Without buffer device
addresses the counting stays on the CPU.
2026-10-04 16:17:09 +13:00
..
ColorTransfer.comp perf(agc): batch GPU work in a recorder with host-imported guest memory 2026-09-25 16:27:49 -07:00
MeshArguments.comp perf(agc): draw mesh-stage indirect draws on the GPU 2026-10-04 15:45:56 +13:00
SampleCounter.comp perf(agc): record occlusion counter dumps on the GPU 2026-10-04 16:17:09 +13:00
TextureDetile.comp perf(agc): dispatch and draw recipes, data-only cache hits, unit shadows, bindless image tables 2026-09-26 19:00:40 -07:00