Commit Graph
1791 Commits
Author SHA1 Message Date
Yunus Shaikh 6d0ff6cd85 Merge main into fix/agc-msaa-d32s8-separate-stencil
The conflict in core/libs/prx/libSceAgcDriver/CMakeLists.txt from #12862's split is resolved with tools/agc_test_split.py resolve, which moves this PR's test registrations into tests/cmake/.
2026-10-31 15:06:09 -07:00
Adrià b8f0a6b202 Merge pull request #13667 from chitters2004/perf/prebuild-bound-programs
perf(agc): run first the library prebuilds of programs a submission binds
2026-10-31 12:52:52 +01:00
Adrià 3a6711d08b Merge pull request #13621 from beardsciences/fix/idle-store-yield
fix(agc): yield the queue-idle storage write-back to new work
2026-10-31 11:03:08 +01:00
Adrià beb7ce3c4a Merge pull request #13610 from ntamas94/up/gcn-draw-relocate-user-words
perf(agc): relocate cached draws across moved user-data V#s and fetch subroutines
2026-10-31 10:22:36 +01:00
Adrià 1b91748340 Merge pull request #13613 from Filip722/perf/agc-driver-id-reuse-20261030
perf(agc): reuse the queried driver ID during device setup
2026-10-31 10:20:32 +01:00
ntamas94andClaude Opus 5.5 9ea244c4c1 Merge branch 'main' of https://github.com/boykopovar/AnyPS5 into up/gcn-draw-relocate-user-words
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-31 08:11:21 +01:00
ntamas94andClaude Opus 5.5 183b781e5f fix(agc): keep a shared V# record count in the relocated draw key
A record-count user word was made relocatable after only the push,
specialization and captured-word checks. When the same word also builds
a second descriptor, the relocated stage patched the first descriptor's
count and kept the second one's earlier count. A count word is now
relocatable only when it appears in exactly one binding word, like the
base word.

agc_driver_draw_relocate_user_values gains the tagging case with two
read-only bindings sharing a count, and a draw that builds two descriptors
from one count SGPR, grows that count after the relocation is learned and
checks the second descriptor's newly covered dword; a control with a count
SGPR per descriptor still relocates and draws the grown range.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-31 07:42:53 +01:00
Yunus Shaikh 071ca5b609 Merge main into fix/agc-msaa-d32s8-separate-stencil
Beyond keeping both sides:
- CMakeLists.txt:3149-3153: agc_driver_native_depth_buffer_clear joins
  the branch's set_tests_properties lists for the native depth tests
  (and the WIN32 list) instead of main's own line that re-lists clears
  and clear_refusals; the properties are the same.
- NativeMultisampleDepth.cpp:1153-1170: main's two
  completionCandidate && fault == ClearFault::None blocks sit around
  ArmHtileDepthClear inside the branch's ClearSource::HtileDispatch path,
  where the branch moved that code; the fill paths make no HTILE clear
  candidate.
- NativeMultisampleDepth.cpp:2556: main's --buffer-clear call passes
  ClearSource::HtileDispatch, the parameter the branch added to
  CheckDepthTarget.
2026-10-31 05:40:26 +00:00
Celegans12 448aa816b6 perf(agc): expand an HTILE on the GPU behind a pending mask clear kernel
Record an HTILE clear's mask/value with its pending note and recorder ID.
When that write covers the HTILE and determines its ZMask/SMem bits,
expand the metadata on the GPU without a readback. Retire mask proofs
with their recorder or depth device, preserving other owners and the
bounded cache's conservative overlap invalidation.
Recognize the structured-buffer variant and carry its completion range
through preparation, upload and binding. Admit only that range while
its native owner has a pending clear, retaining color guards and
excluding these resources from dispatch and recipe caches.
Cover store-back, PM4 buffer clears, guard refusals, recorder recreation,
live owner isolation and scoped cleanup with GPU byte/wait assertions.

AI-assisted: yes
2026-10-31 05:46:37 +01:00
Jamie ca40151bc7 perf(agc): bound the bound-program scan and queue reorder 2026-10-30 23:06:37 +00:00
JamieandClaude Opus 5.5 01b6d04869 perf(agc): run first the library prebuilds of programs a submission binds
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 22:36:34 +00:00
Christian 859777b551 fix(agc): yield the queue-idle storage write-back to new work
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.
2026-10-30 16:38:03 -04:00
Adrià 3410406e07 Merge pull request #13373 from mrfelek/perf/adaptive-staging
perf(agc): keep a staged element in place when its frames are faster
2026-10-30 20:57:01 +01:00
ntamas94andClaude Opus 5.5 306b439fd6 perf(agc): relocate cached draws across moved user-data V#s and fetch subroutines
A draw found through a relocation alias (#4943) may only move user words
that the stage's SRT walk used as a base and never as a value. Two kinds of
user words that move between otherwise equal draws fell outside that:

- A buffer V# held directly in user SGPRs. Its words are values, so a move
  was refused. When the V# base appears only in one read-only GuestBuffers
  element of the compiled stage (the next two words equal, not in push data
  other than its own forwarded slot, not in specialization constants or
  captured words, and no captured run inside its range), its base and
  record words are relocatable: they leave the alias key, and the relocated
  stage patches that element's descriptor.
- The s_swappc target of a GCN vertex program (its fetch subroutine). It is
  linked into the code, so a move was refused. Such a word is relocatable
  when it feeds no binding, push word or captured word, and its alias key
  hashes the callee's code (UserDataCalleeLength words at the address),
  so a copy of the same subroutine elsewhere relocates and changed code
  does not.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 20:30:28 +01:00
Filip Michalski 97ab75bff4 Merge remote-tracking branch 'origin/main' into perf/agc-driver-id-reuse-20261030 2026-10-30 20:29:53 +01:00
Filip Michalski eee55da496 perf(agc): reuse the queried driver ID during device setup 2026-10-30 20:16:30 +01:00
Adrià 231336e48c Merge pull request #12657 from chitters2004/fix/agc-journal-compute-build-once
fix(agc): build a replayed compute pipeline once when a dispatch races it
2026-10-30 20:13:09 +01:00
Yunus Shaikh dcf420ec7f Merge main into fix/agc-msaa-d32s8-separate-stencil
# Conflicts:
#	core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
#	core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
2026-10-30 18:00:31 +00:00
mrfelek 17c3920ac4 perf(agc): keep a staged element in place when its frames are faster
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.
2026-10-30 16:38:05 +01:00
Dean ed1e0ed08f Merge pull request #13252 from hugodearaujo/fix/label-takes-prune
perf(agc): prune and gate the label take records
2026-10-31 03:46:31 +13:00
JamieandClaude Opus 5.5 307f2202e7 fix(agc): build a replayed compute pipeline once when a dispatch races it
ReplayComputePipeline never registered its build in computePipelinesBuilding, so a dispatch of the same pipeline during the journal replay compiled it again. Register the build the way computePipeline() does, so the dispatch waits for it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 13:38:35 +01:00
Adrià cc7b82ac6f Merge pull request #12702 from MarcZX10/feat/overlay-pad-status
feat(overlay): show controller status on demand or on connect, disconnect and battery drop
2026-10-30 13:05:28 +01:00
Adrià e7529df44e Merge pull request #12996 from JJenkx/windows/diagnostics-unicode-paths
fix(diagnostics): open VideoOut telemetry and sampler files under any Unicode path on Windows
2026-10-30 10:55:46 +01:00
Dean 957970b247 Merge pull request #12147 from milescoviello/fix/prebuild-compile-budget
fix(agc): bound the SPIR-V that background compute pipeline builds compile at once
2026-10-30 22:20:34 +13:00
hugodearaujo aee6ce2fd9 perf(agc): prune and gate the label take records
A queue's passes on label dwords and the takes its own stores make of them move to LabelTakes. A wait only considers stores recorded after its submission entered the driver, so a pass or take at a serial no newer than that entry can no longer hide a store: each queue's passes are kept in serial order and dropped when its worker starts a submission received after them (for a rewind tail, the oldest submission of the queue still pending bounds it).

noteLabelIssue reads a per-(queue, dword) count of live passes without the lock and takes labelStoresMutex only when a pass may exist. Passes and takes of a queue, and its stores that take them, all run on that queue's worker.
2026-10-30 04:56:45 -03:00
Adrià 712fc0e924 Merge pull request #12378 from BunnyFl/perf/write-watch-page-exclusion
perf(agc): exclude only an import's own pages from the write watch and settle partial-block imports in the background
2026-10-30 06:54:29 +01:00
MarcZX10 81a6ad4e9a refactor(agc): drop the pad status observe entry point
The host's pad code now reaches the display only through the poll, so
the observe entry point has no caller. The shared-display tests use the
poll and also pin that, with ANYPS5_PAD_STATUS unset, the provider is
not read until a request, is read at once with ANYPS5_PAD_STATUS=1, and
that an invalid value stops the first poll with an error naming the
variable.
2026-10-30 05:55:09 +01:00
MarcZX10 45edae3108 feat(agc): read the pad snapshot only while the panel is wanted
PadStatusDisplay::Poll asks the provider for a snapshot only when the
panel can be shown: in the events mode always, otherwise only while a
request keeps it visible. With ANYPS5_PAD_STATUS unset or 0 and no
request the provider is not called, so the host builds no snapshot and
reads no controller state for it. An unchanged snapshot is not observed
again, and a display that stopped being polled observes the next
snapshot afresh when a request makes it wanted again. The entry point
for the host's pad code is AgcDriverPadStatusPoll_nid_postfix.
2026-10-30 05:55:09 +01:00
MarcZX10 88ee3f3119 refactor(agc): move the pad status types to a header without Vulkan
The host's pad code describes a controller with PadSlotStatus,
PadStatusSnapshot and PadStatusProvider, and test executables that
include its headers do not have the Vulkan headers on their include
path. The types and the player slot count move to PadStatus.hpp, which
needs only the standard library; PadStatusOverlay.hpp includes it.
2026-10-30 05:54:47 +01:00
MarcZX10 c5159ec660 feat(agc): draw the pad status panel over the presented image
The presentation records the panel after the overlay plane and the
system keyboard and before the performance overlay, in its own overlay
instance, and chains the image layouts through it like the keyboard's.
The system keyboard has priority: while it is shown the panel is not
drawn. With the panel hidden, which is the case unless ANYPS5_PAD_STATUS=1
or a request shows it, every layout and branch of the presentation is
the one it was.
2026-10-30 05:54:47 +01:00
MarcZX10 7a9ef1ecf2 feat(agc): lay out the pad status panel
The panel reuses the performance overlay's layout and font: a 32-column
text-only OverlayContent. It sits in the corner mirrored horizontally
from ANYPS5_OVERLAY_POS, so it never covers the performance overlay
when both are shown. PadStatusDrawn() gives the system keyboard
priority: the panel is not drawn while the keyboard is. PadStatusOverlayLines()
returns the lines to draw now, or nothing while the panel is hidden, and
the observe and show entry points are the ones the host's pad code
will call.
2026-10-30 05:54:25 +01:00
MarcZX10 634d8eef1d feat(agc): format the pad status lines
One line per slot that has ever had a controller: "P1 DUALSENSE  WIRED",
"P2 XBOX  BATTERY MEDIUM" or "P3 DISCONNECTED". The overlay font draws
digits, upper-case letters and a few signs, so a controller name from
the host is reduced to those glyphs and cut to 12 columns with a final
dot; every line fits the 32-column panel. A battery the host cannot
report reads "BATTERY UNKNOWN". With no controller seen the display
lists "NO CONTROLLER".
2026-10-30 05:54:25 +01:00
MarcZX10 be8944ec90 feat(agc): add the pad status display state machine
A controller status panel for the overlay needs to stay on screen for a
few seconds and then disappear. PadStatusDisplay keeps that state with
an injected clock: ANYPS5_PAD_STATUS=1 shows it for 4 s when a slot
connects, disconnects, changes controller or enters a lower battery
class, a new event restarts the 4 s, and Request() shows it on demand
whatever the mode. With ANYPS5_PAD_STATUS unset or 0 only Request()
shows it. A value other than 0 or 1 is refused with an error naming the
variable.

The pad status types (PadSlotStatus, PadStatusSnapshot and the
PadStatusProvider seam) carry no SDL types so tests can inject them.
Nothing reads the display yet.
2026-10-30 05:54:24 +01:00
Dean 5ecef095b6 Merge pull request #12923 from hugodearaujo/fix/agc-label-taken-store
fix(agc): don't release a label wait on a store its queue already took and reset
2026-10-30 16:50:24 +13:00
Dean 3d2d264392 Merge pull request #12916 from Tehshortbus/feat/multi-target-merge
feat(agc): merge a draw into more than one unclamped normalized color target
2026-10-30 16:49:46 +13:00
Adrià 0c9c5db748 Merge pull request #12690 from MarcZX10/feat/host-system-report
feat(agc): host system report and an actionable missing-Vulkan-feature message
2026-10-30 02:52:18 +01:00
Adrià e8cfff0a08 Merge pull request #12171 from slopgobblercobbler/fix/agc-draw-pipeline-report-duplicate-format
fix(agc): eliminate duplicated read counters in pipelined draw reports
2026-10-30 02:51:11 +01:00
Adrià d0cf19b2cb Merge pull request #12233 from beardsciences/fix/nvidia-mesh-window-buffer
fix(shader): keep mesh register windows out of local memory on NVIDIA
2026-10-30 02:31:36 +01:00
Adrià 086adee5e3 Merge pull request #12379 from MarcZX10/feat/msgdialog-overlay
feat(overlay): show PS5 system dialogs as real PC dialogs
2026-10-30 02:04:23 +01:00
Adrià f6fddd60d8 Merge pull request #9243 from fisherjoey/perf/draw-cache-indirect-admission
perf(agc): cache CPU-path indirect draws behind APS5_DRAW_CACHE_INDIRECT
2026-10-30 01:51:25 +01:00
Adrià 673fa865f4 Merge pull request #10140 from frankea/fix/user-data-callee-window
fix(agc): read user-data callees up to the 1 MiB raw shader program limit
2026-10-30 01:25:59 +01:00
Adrià 2a8274f328 Merge pull request #9738 from mugurc/fix/agc-preparation-lifecycle-exit
fix(agc): keep the shader preparation lifecycle mutex alive through exit
2026-10-30 00:56:51 +01:00
Yunus Shaikh 6eb141ce5f Merge main into fix/agc-msaa-d32s8-separate-stencil
Main's 102b7a5cf0 brings #12566's HostOnlySampleRanges, added in MultisampleTarget.cpp where this branch adds MultisampleColorTargetOver; the merge keeps both.
2026-10-29 13:48:16 -07:00
Adrià b68fff81f2 Merge pull request #11957 from Bram910/perf/shader-region-merge
perf(agc): merge shared shader regions with a heap
2026-10-29 21:20:26 +01:00
Dean bfc5ee4101 Merge pull request #12264 from Tehshortbus/perf/agc-written-buffer-index
perf(agc): find a range's newest writer through a granule index instead of scanning the ring
2026-10-30 09:19:10 +13:00
Adrià ce9394b844 Merge pull request #12566 from chitters2004/fix/agc-capture-host-only-msaa
fix(agc): write host-only multisample memory as zeros in a capture snapshot
2026-10-29 21:19:01 +01:00
JJenkxandClaude Opus 5.5 ec7d2f5b85 fix(diagnostics): publish the sampler's collapsed stacks through MoveFileExW
The collapsed-stacks file is written to a .tmp next to it and then moved
over the final name. That move still used MoveFileExA with the UTF-8
path, so under a non-ASCII directory the .tmp was never published.
Both paths now go through std::filesystem::path and MoveFileExW, with
the same MOVEFILE_REPLACE_EXISTING.

The worker sampler test now also reads the published .collapsed.txt,
checks its "# samples=N" header with N > 0, and checks that the .tmp is
gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 16:07:31 -04:00
JJenkxandClaude Opus 5.5 74ec7311f1 fix(diagnostics): open VideoOut telemetry and sampler files under any Unicode path on Windows
APS5_VIDEOOUT_TELEMETRY_DIR, APS5_SAMPLE_THREADS, APS5_SAMPLE_WORKER and
APS5_SAMPLE_COMMITTER were read with getenv and opened with the narrow
fopen/ofstream, so on Windows they worked only for characters in the
ANSI code page, and the tests, which pass UTF-8 path.string() values,
failed whenever %TEMP% was not ASCII.

They are now read with _wgetenv and carried as UTF-8, as the other
diagnostic directories (ANYPS5_SCREENSHOTS, APS5_DUMP_SUBMITS,
APS5_PAD_INPUT_FILE) already are, and the files are opened through
std::filesystem::path. The worker sampler test sets its variables with
_wputenv_s and reads the results through std::filesystem::path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 15:26:10 -04:00
hugodearaujo 780d350fbb perf(agc): decode a label write without allocating before noting a taken store
noteLabelIssue runs for every executed store packet. RELEASE_MEM and WRITE_DATA, the common label writes, now go through DecodeLabelWrite, which DecodeStores already used for them and which allocates nothing, and stores the label history doesn't keep are dropped before labelStoresMutex is taken.
2026-10-29 13:07:12 -03:00
MarcZX10 17ff9177fb fix(agc): read the host CPU model and missing features through the exported helpers
libSceAgcDriver.prx failed to load in the patched library check with an undefined symbol for HostCpuModel, because the host report called libkernel's plain C++ functions, which the patched libkernel does not export to it. The report now calls the extern C helpers and splits the joined feature list back into names.
2026-10-29 14:20:35 +00:00