Capture costly compute builds and restore matching recipes after checking
full recipes, driver fingerprints and Vulkan compatibility keys. Add size
and time thresholds, opt-out, atomic persistence and corruption/rejection
fallback.
Remember below-threshold recipes in separate files so competing decisions
cannot overwrite captured binaries. Prefer saved binaries and retry
capture when the time threshold is lowered.
Cover compatibility, fallback, deterministic competing writers and
cross-process capture, restore and corruption.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The label read trap skipped every image sharing a page with another
pending image. Large tiled images are never stored at a label, so an
image inside one no longer counts as sharing. A store of an image over a
trapped one now stores the trapped one in the same flush, and an
eviction or explicit write-back stores the trapped images inside it
first.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The trap was released when FlushPending took the image out of the pending
registry, before it waited for GpuMutex, so a read in between saw the old
bytes; cache eviction and explicit write-backs did not release it at all.
Every store now releases it in writeBackLayers: after recording the GPU copy
into the import, or before the first CPU access on the CPU path, which also
releases the traps of other images on the same pages. A trapped image is
stored whole, and direct memory mapped at a second address is not trapped.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Before a label, a pending linear or small storage image that shares no page
with another pending or storing image now gets a write-watch read trap
instead of its store. The first access to its pages stores it through the
host-read hook; any other store releases the trap first.
APS5_NO_LABEL_READ_TRAP=1 keeps the store at the label.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The PS4 tiling entry said pipe and bank of every PRT mode come from the coordinates inside the macro tile. It now says so for GB_TILE_MODE 11 and 16, and a new entry names the four 2D PRT modes (6, 7, 12, 17), where this code follows shadPS4 and AMD's addrlib and fpPS4 use the whole coordinates. Nothing is claimed about the console.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Queue 0's idle store wrote every pending storage image back to guest memory
in one pass once the queues had been idle for 50 ms. In a title's movies
that is about 15 upscaled 3840x2176 targets (~0.5 GB) per pass, and the
title's next flip waited ~0.6 s behind it, about every 3 s.
The idle store now writes back 4 MiB at a time, in the block units the
images already track, and stops as soon as queue 0 has queued work or
another queue is running; the rest stays pending for the next idle period.
The quiet period is unchanged.
Firmware 13.42 libSceAgcDriver.sprx answers sceAgcDriverAcquireRazorACQ,
GetPaDebugInterfaceVersion, SetHsOffchipParamDirect,
SubmitMultiCommandBuffersDirect, SubmitToRazorACQ and
SuspendPointSubmitDirect with 0x8A6D0001 and ModuleRegistration with
0x8A6D0003 for every input, like SetTargetRingForDiag.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Staging a swept write-only element (#7618) costs a copy-in and a
copy-back per use. In PPSA03912's town that saves GPU time, but in its
main menu the 202 MiB element is faster in place (73 vs 91 ms of GPU
time per frame), so the menu lost about a fifth of its frames.
Decide per element by measurement. The busiest element is probed in
its current mode, the other mode and its current mode again; the other
mode is kept when its frames are faster by more than twice the
standard error. A repeated answer doubles the wait for the next probe
from 20 s up to 160 s, and a jump of the frame GPU time by more than a
quarter (a scene change) probes again at once. The frame GPU time comes
from the whole-batch timestamps, which the first probe turns on.
Resource builds made under the other decision are not reused.
APS5_NO_ADAPTIVE_STAGING=1 stages every eligible element, as before.
The policy is in AdaptiveStaging.hpp, fed by the caller with frame
counts and time; agc_adaptive_staging covers keeping the faster mode,
frame noise, the back-off cap, a scene change and the share threshold.
AI-assisted. Tested by me on my own machine.
Two sentences in the PS4 layered surfaces and display buffers entries. AMD's address library and shadPS4 XOR the bank rotation of an array layer into the bank, which this code does since the layer rotation change, and fpPS4 adds it. shadPS4 rounds the width of a tiled display buffer up to 128 itself, whereas DisplayBufferSize requires the pitch to be a multiple of 128 already. Nothing is claimed about the console.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The pixel shader reads the color target through a storage image without
a format, so the recompiler refuses the shader on a device without
shaderStorageImageReadWithoutFormat. The sentence on unblended targets
goes, to keep the entry within the 1000-character limit. Asked for by
oneandonlydean in review.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keeps both sides of the debt doc: this branch's multisampled color
target entry and #6498's shader buffer entry. The test file merges with
both sides' test blocks. HostOnlySampleRanges from #12566 reads the
host-only flag from the range's TargetUse.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A depth plane with the 64 KiB Z swizzle reloads the units the guest
wrote (SyncFromMemory) when its surface is bound as a depth target, but
sampling the plane through the surface skipped that check and read the
host image. A title that copies depth into the plane with a buffer copy
and samples it before drawing into it again read the depth from before
the copy.
PPSA05684 copies its depth pre-pass into a second depth target with a
buffer copy kernel and samples that copy at once to build the
half-resolution depth its volumetric fog and dust read; only later does
it bind the target. The fog used the previous frame's depth, so a
silhouette followed every moving character through fog and dust.
Sampling a single-sample plane through its surface now runs the same
reload first. agc_driver_depth_plane_sampling gains a case that draws a
plane, writes the guest memory under it and samples it; it reads the
drawn depth without the change.
AI-assisted: yes