Commit Graph
2476 Commits
Author SHA1 Message Date
Yunus Shaikh a63bd1432f Merge #9533's merge of main into feat/agc-msaa-d32s8-stencil-view
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:22 -07:00
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
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
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
Yunus Shaikh a90d0b73bb Merge main into feat/agc-msaa-d32s8-stencil-view
Main comes in through #9533's main merge 071ca5b609, which keeps
#9533's resolution; this branch carries #9533 but not #9742.

Beyond keeping both sides:
- CMakeLists.txt:3150-3154: agc_driver_native_depth_buffer_clear joins
  the branch's set_tests_properties lists, which also carry
  agc_driver_native_depth_stencil_view.
2026-10-31 05:40:36 +00: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
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
Yunus Shaikh 8fe640ecdb Merge fix/agc-msaa-d32s8-separate-stencil into feat/agc-msaa-d32s8-stencil-view 2026-10-30 18:00:51 +00: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
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
Adrià 583b274e11 Merge pull request #12238 from XairRrR/fix/agc-sampled-depth-plane-reload
fix(agc): reload a sampled depth plane the guest wrote since its surface was bound
2026-10-30 06:32:54 +01: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à 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à db98f92d9a Merge pull request #11740 from thuanquang/perf/t1-rerun-own-alias
perf(agc): accept a refreshed view in the T1 re-run when the lookup would not view the pending alias
2026-10-30 02:01:53 +01:00
Adrià 401e4babaa Merge pull request #11075 from slopgobblercobbler/fix/agc-pipeline-cache-header-validation
fix(agc): validate pipeline cache header format and empty cache paths
2026-10-30 01:38:51 +01:00
Dean 55ef952e4d Merge pull request #10854 from milescoviello/fix/depth-view-chain-past-plane
fix(agc): count pending storage writes over a depth plane as a later writer
2026-10-30 13:20:30 +13:00
milescovielloandClaude Opus 5.5 e2c1c305ff fix(agc): release texture cache entries before a budget-full allocation goes to host memory
DeviceMemoryType placed an image or device buffer in host memory up front
when VK_EXT_memory_budget showed the device-local heap without room, so the
texture-cache release that a driver refusal gets never ran. It now asks the
caches for the allocation plus the heap's overage first and keeps the
device-local type when they release that much, or when the budget read again
has room.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 00:05:44 +00:00
Adrià 39fc186c97 Merge pull request #11550 from johandavidcm/feat/agc-revalidate-collect-fails
feat(agc): count why a template's collect was refused
2026-10-30 01:04:12 +01:00
Dean 3d1b1c30e8 Merge pull request #12074 from mehmetbayoglu/fix/agc-import-yield-mirrorable-pr
fix(agc): let heap mirrors replace host imports when the import budget is full
2026-10-30 12:20:39 +13:00