Commit Graph
2471 Commits
Author SHA1 Message Date
Dean 3a1457d34f Merge pull request #7261 from tibzejoker/perf/import-proof-reconcile
perf(agc): keep a resource set's import proof across registry changes that leave the imports in place
2026-11-01 19:18:32 +13:00
Adrià 588f2f6fe3 Merge pull request #13883 from hugodearaujo/fix/agc-own-unlanded-label
fix(agc): don't pass a label wait on memory its own queue already reset
2026-11-01 06:41:04 +01:00
Dean a8b98da3a5 Merge pull request #7985 from milescoviello/fix/library-attachment-samples
fix(agc): copy a linked pipeline's color sample counts only when it has color attachments
2026-11-01 17:06:22 +13:00
Dean 8c91f25b39 Merge pull request #10886 from meh7an/perf/agc-unit-flags
perf(agc): track pending and borrowed texture units in 64-bit words
2026-11-01 16:52:46 +13:00
Dean 0db3833e33 Merge pull request #11602 from XatiX/perf/agc-untracked-htile-scan
perf(agc): keep the HTILE clear check of untracked memory until its stamp moves
2026-11-01 16:23:37 +13:00
Dean dcda6bbd53 Merge pull request #7310 from Amoenus/codex/feat-volume-color-mips-mainaf
feat(agc): render into mipmapped 3D color targets
2026-11-01 14:53:04 +13:00
Dean Galvin 3f74bf0f96 Merge main into perf/agc-unit-flags 2026-11-01 13:38:19 +13:00
Romans Pokrovskis 2c1f59472a merge: refresh volume mip tests after registration split 2026-10-31 23:29:28 +02:00
Kang, Harry Zixuan 4eb530d609 fix(agc): account for mesh window memory 2026-10-31 14:05:16 -07:00
Kang, Harry Zixuan 5b252678e7 fix(agc): keep deferred memory counted until actual release 2026-10-31 14:05:15 -07:00
Kang, Harry Zixuan fe1d6e4370 fix(agc): align accounting with merged memory paths 2026-10-31 14:05:07 -07:00
Kang, Harry Zixuan f0c40d8f24 fix(agc): reclassify reused buffer memory 2026-10-31 14:05:01 -07:00
Kang, Harry Zixuan 465aa0a238 feat(agc): trace device memory allocations and cache budgets 2026-10-31 14:05:00 -07:00
AshwinandClaude Sonnet 5.5 ed3b5393f1 fix(agc): keep mirrors with queued refresh blocks out of eviction
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-31 22:20:48 +05:30
AshwinandClaude Sonnet 5.5 902289426b fix(agc): drop queued refresh blocks of an evicted heap mirror
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-31 21:22:20 +05:30
Ashwin c5b518ff69 fix(agc): evict unreferenced heap mirrors under memory pressure 2026-10-31 21:22:20 +05:30
hugodearaujo e11df016ff fix(agc): hold a label wait on each awaited dword its own queue reset
UnlandedOwnLabel took a queued entry only when it was the caller's own and
fell back to the recorded one otherwise, so an older recorded store of the
waiting queue counted as its newest even when another queue had a newer
queued store of the dword, and an older own queued store won over a newer
recorded store of another queue. It also answered nothing unless every
awaited dword was the queue's own, so an 8-byte wait passed on memory that
the queue's pending reset of one dword was about to change.

The lookup now takes the newest tracked store of each dword, queued or
recorded, by stamp, and reports the value and the dwords whose newest store
is the queue's own and not overwritten. OwnStoreRejects composes what the
wait would read once those stores land (own dwords from the table, the rest
from memory) and keeps the wait only when that value fails the compare, so
the wait's mask and function decide as before and another queue's later
store of a dword still releases it.
2026-10-31 09:25:53 -03:00
Adrià d50e1cef6e Merge pull request #13656 from jotitadev/fix/agc-slab-retile-index-after-slab-check
fix(agc): check a write-back piece is in a slab before reading its slab copy
2026-10-31 12:28:10 +01:00
Adrià 4e2c5a72e6 Merge pull request #13648 from JJenkx/windows/agc-clear-sampled-texture-on-gpu
perf(agc): clear a fast-cleared sampled texture on the GPU
2026-10-31 12:12:02 +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
hugodearaujo 14bcc1a206 fix(agc): don't pass a label wait on memory its own queue already reset
A WAIT_REG_MEM passes as soon as guest memory satisfies its compare. A queue
that resets a label right after its wait on it passed, and waits on it again
before that reset reached memory (the store is recorded on the GPU behind
other work, or still queued), found the old value in memory and passed the
second wait without a new store from the other queue. Skyrim (PPSA03747)
does this on queue 0x28: two passes on 0x112a800020 per signal of queue 0
let the two queues drift a step apart, and later signals overlap and get
lost until both wait forever.

Recorder::UnlandedOwnLabel reports the value a queue's own newest stores of
a label leave once they land, when every awaited dword's newest tracked
store is that queue's, still queued or in a batch not reaped yet, and no
later recorded GPU write covers it. A wait whose memory satisfies the
compare while such a store rejects it keeps waiting (at entry, in the poll
loop and on the pipelined queue-0 path), and reaps while it sleeps so the
store's entry leaves once it landed. Landing waits are unchanged.
2026-10-31 05:16:03 -03: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
Adrià 6889f9a87d Merge pull request #13527 from JJenkx/windows/agc-dcc-clear-fill-doubling
perf(agc): fill a DCC fast-clear surface by doubling copies
2026-10-31 01:40:18 +01:00
Jota 23c2c9b302 fix(agc): check a write-back piece is in a slab before reading its slab copy
The whole-window retile check bound slabPieces[part.pieces].copies[part.copy]
before testing part.slab. A piece stored into the import records pieces = 0,
and when no piece of the write-back went to a slab slabPieces is empty, so
the lookup binds a reference through a null pointer (UBSan: reference
binding to null pointer, Texture.cpp:3514).
2026-10-30 18:58:08 -03:00
Adrià c9d187be2b Merge pull request #13492 from wrocketdev/fix/agc-tessellation-cull-distance
fix(agc): accept cull distances from tessellation evaluation shaders
2026-10-30 22:51:23 +01:00
Adrià 369d29383e Merge pull request #13448 from frankea/perf/barycentric-patch-validation-key
perf(agc): key draws through generated barycentric tessellation stages in the shader validation memo
2026-10-30 22:04:27 +01:00
JJenkxandClaude Opus 5.5 a8202ea542 perf(agc): clear a fast-cleared sampled texture on the GPU
A sampled texture made from a surface whose DCC keys hold a fast-clear
code was filled on the CPU with the clear texel (FillDccClear over the
whole surface), copied into a staging buffer, copied to a tiled device
buffer, detiled and copied into the image. A target cleared every
frame and sampled while cleared repeats all of it each time.

When the texture's format is the one the clear texel is encoded in and
the texel has an exact clear value (ClearColorForTexel), the image is
now cleared with vkCmdClearColorImage instead, in the same recorder
batch the upload used. Comparison, sRGB-expand, repacked, block
compressed and register-clear surfaces keep the upload. A clear-code
cache hit never compares bytes, so such an entry keeps no snapshot.

The [textures] profile line counts these as cleared on the GPU, and
SampledTexturesCleared() reports them for the new execution test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 16:57:15 -04: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
JJenkxandClaude Opus 5.5 37a0dbc26a perf(agc): fill a DCC fast-clear surface by doubling copies
FillDccClear wrote a cleared texture one element at a time, with one
memcpy of 4 to 16 bytes per element. A cached texture whose DCC keys
say cleared is filled this way on every upload, so a 4K RGBA8 surface
took about eight million calls. Copy the first element, then copy the
filled prefix onto the rest, doubling each time; the last copy is
clipped at the last whole element and the trailing partial element is
zeroed as before. The bytes written are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 12:52:33 -04:00
ThomasandClaude Opus 5.5 74164be133 fix(agc): accept cull distances from tessellation evaluation shaders
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 17:50:07 +01: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
frankea f397ab7809 perf(agc): key draws through generated barycentric tessellation stages in the shader validation memo
On a device without VK_KHR_fragment_shader_barycentric and without geometry shaders, a pixel shader that reads barycentrics is drawn through tessellation stages generated for the draw. Those stages carry no variant id, so ValidationKey left every such draw unkeyed and ValidateShaders decoded all four stages again on every draw. The generated stages are built from the vertex and fragment results the key already names and from the provoking vertex, so they are keyed like the rect-list stages, with the provoking vertex added to the key.
2026-10-30 10:54:57 -04:00
Adrià 4f631cb4e1 Merge pull request #6628 from MarcZX10/codex/bda-msaa-range-guard-6625
fix(agc): exclude native MSAA spans from BDA tables
2026-10-30 14:47:54 +01:00
Dean 25e8a2cbb8 Merge pull request #8223 from savvaniss/fix/agc-retire-overwritten-msaa
fix(agc): retire a multisampled color target the title wrote over
2026-10-31 01:16:02 +13:00
Dean e7c1b0a5af Merge pull request #9565 from EagleBearerYS/port/fable-fix-command-buffer-release
fix(agc): free a completed batch's command buffer instead of keeping it
2026-10-31 00:16:35 +13:00
Savvanis SpyrosandClaude Opus 5.5 adc96735c6 Merge main b7488e1ff5 into fix/agc-retire-overwritten-msaa
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]>
2026-10-30 12:09:06 +02:00
Adrià eeee85fa43 Merge pull request #12998 from xXPBSXx/fix-agc-gcn-array-bank-rotation
fix(agc): rotate the bank of PS4 array layers like addrlib
2026-10-30 10:55:54 +01:00
Adrià 2e2d5dae8e Merge pull request #13013 from SeaSunPT/fix/agc-rewatch-cleared-host-imports
fix(agc): rewatch the ranges of compared host imports that ClearHostImports drops
2026-10-30 10:42:18 +01:00
Adrià 664297cc2a Merge pull request #12983 from Oscar45397/fix/libSceAgcDriver-unnormalized-trunc-coord
fix(agc): accept TRUNC_COORD on unnormalized samplers
2026-10-30 10:19:58 +01:00
Dean dad4f21493 Merge pull request #13064 from milescoviello/fix/agc-reclaim-before-budget-host
fix(agc): release texture cache entries before a budget-full allocation goes to host memory
2026-10-30 22:19:50 +13:00
Dean 409fe64199 Merge pull request #11615 from dantdmdarealguy/perf/agc-linear-writeback-row-padding
perf(agc): leave a linear storage write-back's row padding in the import
2026-10-30 20:49:49 +13:00
MarcZX100 fb1260b855 fix(agc): invalidate cached BDA tables on metadata retirement 2026-10-30 07:46:23 +01:00
MarcZX100 23bfa5787d fix(agc): restore cached BDA table range 2026-10-30 07:46:23 +01:00
MarcZX100 50e0836bdb style(agc): remove cache key comments 2026-10-30 07:46:23 +01:00
MarcZX100 ce55f5f672 fix(agc): retain equivalent BDA space cache keys 2026-10-30 07:46:23 +01:00
MarcZX100 572dfb6f19 style(agc): remove non-debt cache comment 2026-10-30 07:46:23 +01:00
MarcZX100 b82506224f fix(agc): retain BDA table fast path with MSAA guards 2026-10-30 07:46:23 +01:00
MarcZX100 4189ea4f02 fix(agc): exclude native MSAA spans from BDA tables 2026-10-30 07:46:23 +01:00
Adrià 0839e8f344 Merge pull request #12559 from Filip722/perf/agc-packed-target-dcc-20261028
perf(agc): allow compression of packed-float image backing
2026-10-30 07:13:36 +01: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