Commit Graph
2368 Commits
Author SHA1 Message Date
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
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
Dean 341cf8beee Merge pull request #6498 from Amoenus/codex/fix-msaa-buffer-alias-mainfa
fix(agc): refuse buffer aliases of native MSAA targets
2026-10-30 12:19:53 +13:00
Adrià ebb4075168 Merge pull request #12164 from slopgobblercobbler/fix/agc-color-target-snorm-mapping
fix(agc): remap B8G8R8A8_SNORM color target format to guest format 57
2026-10-29 23:01:20 +01:00
milescovielloandClaude Opus 5.5 a079dec978 fix(agc): count pending storage writes over a depth plane as a later writer
A sampled view that a live depth surface's plane cannot serve (another
layout, more levels) is left to guest memory when a later write retired
the surface, and refused while the surface is the last writer of its
memory. Only writes the CPU can see counted. A compute pass that writes
storage images over the plane is a later writer too, but its results
stay pending in storage images, so the surface still looked current.
Forspoken (PPSA03984) builds a 5-level R32 float chain over the memory
of its 1920x1080 D32 depth target. When it sampled the whole chain
before those results reached memory, it stopped on "sampling the depth
plane ... levels 0-4 ... is not implemented". A pending storage result
over the plane now retires the surface for such a view, as a CPU write
there does.

PendingChainCase writes level 1 of a two-level R32 float chain over a
plane with a compute dispatch and flushes it, so the chain's storage
image exists, as the title's does from frame to frame. It then draws a
D32 surface there, writes the chain again and leaves the result pending.
A two-level view must then be left to guest memory with the depth
surface retired. On main the view is refused with the title's message.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 20:26:26 +00:00
Adrià 7b736fe669 Merge pull request #12207 from XairRrR/fix/agc-depth-cube-array-planes
fix(agc): sample a cube array over depth surfaces through their depth planes
2026-10-29 21:21:04 +01:00
Adrià dde1b9f21d Merge pull request #12081 from akkadbakkad89/agc-msaa-single-sample-lines
fix(agc): allow MSAA_ENABLE single-sample lines
2026-10-29 21:20:45 +01: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
Adrià 1578380f6e Merge pull request #12210 from XairRrR/fix/agc-stencil-plane-buffer-coherence
fix(agc): keep stencil planes coherent with guest memory
2026-10-29 20:35:20 +01:00
Adrià 24bfebf957 Merge pull request #11694 from droid2299/fix/agc-small-tiled-label
fix(agc): publish small tiled writes before labels
2026-10-29 14:52:03 +01:00
Christian 6f79055a00 fix(shader): keep mesh register windows out of local memory on NVIDIA
On NVIDIA's proprietary driver, function arrays that live in local memory
and are read under a data-dependent branch return wrong values in
subgroups 1-3 of a mesh workgroup; subgroup 0 is correct. A wave64
geometry program whose relative addressing keeps its VGPRs in the vector
window therefore loses register writes in every wave but the first. In
the clipping geometry program of Sony's PS5 PSP emulator (PPSA07550) the
empty waves never cleared their candidate primitive slots and wrote
degenerate triangles over wave 0's, so the 3D menu drew spikes.

On that driver a mesh program's window now lives in a device-local
storage buffer of 256 workgroup slots of 65536 dwords, claimed through a
per-slot lock and released after the final barrier. The pool is created
before the first draw that uses it records anything, and its header is
zeroed in a batch of its own that is submitted and waited for; the pool
is published only after that wait, and a failure releases it. Direct
register accesses keep one function variable per register; a direct
store also writes the buffer when a buffer read can see it, relative
reads load the buffer, relative writes store only to it, and a direct
read that may follow a relative write loads the buffer and refreshes the
variable. A buffer entry is zeroed only when a buffer read can see it
before a write. APS5_NO_MESH_WINDOW_BUFFER=1 keeps the arrays.
2026-10-29 08:56:39 -04:00
thuanquangandClaude 2c9f79e89e perf(agc): accept a refreshed view in the T1 re-run when the lookup would not view the pending alias
Co-Authored-By: Claude <[email protected]>
2026-10-29 19:48:40 +07:00
slopgobblercobbler c8fcb0bda4 fix(agc): validate pipeline cache header format and empty cache paths 2026-10-29 12:09:44 +01:00
Dean ba5b5330b3 Merge pull request #12706 from Gonic0/fix/agc-barycentric-patches-restart
fix(agc): draw compacted restart lists and restart-free strips through the barycentric patches
2026-10-29 23:56:52 +13:00
Adrià 2a90fb105b Merge pull request #9431 from Get-fix/ps4/agc-gcn
feat(libSceAgcDriver): draw PS4 (GCN) command buffers
2026-10-29 09:31:13 +01:00
Dean 4c7d275bef Merge pull request #11684 from oneandonlydean/feat/agc-unclamped-normalized-blend-v2
feat(agc): blend into an unclamped normalized color target in the pixel shader
2026-10-29 20:48:48 +13:00
memob 8896536f31 fix(agc): import a heap whose mirror left the write watch in place of imports a mirror can replace
A cached address space keeps a heap mirror whose range has left the write watch while the budget refuses the range's import, and such a mirror is copied in full at every build. When the budget is held by imports a build uses every time, as the pieces #8380 imports of a heap over the budget are, the import was refused at every build, each refusal counted, and every build copied the whole range (about 1.1 GiB in Astro Bot). The check now evicts for that import as the copy cap does: idle imports, and imports a heap mirror can replace that no build in progress holds.
2026-10-29 07:50:17 +01:00
memob c280059329 fix(agc): let a range only an import serves evict imports a heap mirror can replace
An address-based build that copies a range the budget refused and no mirror serves (a range outside the write watch, or not releasable) evicts idle imports when the copy would pass APS5_ADDRESS_COPY_MAX_MIB. Imports used in the current or the previous frame (before two frames have ended, within the last 256 lookups) never count as idle, so once a build uses an import every frame, as it does for the pieces #8380 imports of a heap over the budget or a whole heap imported before, nothing can be evicted and the build aborts. That eviction now also takes imports the build has not taken yet whose single range is releasable and write-watched: the build then serves that range from a heap mirror instead.
2026-10-29 07:50:17 +01:00
Nicolas GonzalezandClaude Opus 5.5 95e7deeaab fix(agc): draw compacted restart lists and restart-free strips through the barycentric patches
The barycentric tessellation path refused any draw with the primitive
restart bit set. A non-indexed strip ignores the bit, and on a device
without VK_EXT_primitive_topology_list_restart a list never restarts on
the host, since its indices are compacted on the CPU first, so both now
take the patches. Indexed strips with primitive restart still throw,
now also in Graphics::Draw, which knows the draw is indexed.
Patch-list pipelines never enable primitive restart, which Vulkan does not
allow for them without primitiveTopologyPatchListRestart.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 00:56:03 -03:00
slopgobblercobbler c00695eab4 fix(agc): remap B8G8R8A8_SNORM color target format to guest format 57 2026-10-29 00:44:34 +01:00
Dean c9207624bc Merge pull request #12180 from Gonic0/feat/agc-list-restart-emulation
feat(agc): emulate list primitive restart without VK_EXT_primitive_topology_list_restart
2026-10-29 11:50:11 +13:00
JamieandClaude Opus 5.5 7b38bca9e5 fix(agc): write host-only multisample memory as zeros in a capture snapshot
A capture snapshot read every committed block through the coherent path,
which refuses memory under a multisampled color target, its FMASK or
native multisample depth whose samples exist only on the host, so the
capture stopped there. The snapshot now writes those bytes as zeros,
counts them as host_only_sample_bytes in capture.json and adds a
warning, and the replay starts those targets without their earlier
contents.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 20:27:23 +00:00
XairRrR 1dabe79db2 fix(agc): store a stale stencil plane before retiring its surface for another write
A surface retires when a write overlaps either of its planes. The stencil
plane's pending GPU results were dropped with it even when the write only
covered the depth plane. Retiring for a color target, a storage write or a
guest write now stores a stale stencil plane first unless that write
replaces the stencil plane itself.

AI-assisted: yes
2026-10-28 18:52:26 +01:00
XairRrR a226b66629 fix(agc): sample a cube array over depth surfaces through their depth planes
A cube T# whose last array slice is 6n - 1 is a cube array of n cubes.
The depth plane path accepted one cube only (last array 0 or 5) and
threw for the rest; it now gathers all 6n slices into the 2D array
view, as the texture path already lays cubes out. The refusal message
also names the last array slice and the copy format.

Uncharted 4's orphanage samples a two-cube D32 shadow array this way.

AI-assisted: yes
2026-10-28 18:47:47 +01:00
XairRrR 197c05c9f0 fix(agc): keep stencil planes coherent with guest memory
Only the depth plane of a depth surface reached guest memory: stencil
lived in the host image alone. A title that moves stencil with buffer
copies read stale bytes from the source plane, and the destination
surface never saw what the copy wrote. Uncharted 4 clears its G-buffer
stencil plane with a fill, then copies it into the lighting depth
target and on into last frame's planes with a buffer copy kernel every
frame; its lighting kept the stencil marks of earlier frames, so
characters left trails and the image doubled while the camera moved.

The stencil plane of a single-sample surface with the 64 KiB Z swizzle
is now marked drawn when the surface is bound, stored whole when a read
overlaps it (FlushDepthPlanes, like the depth plane) and reloaded from
guest memory when a collected guest write changed it before the surface
is bound or its stencil sampled, unless a stencil clear is pending.

agc_driver_stencil_plane_memory draws stencil, reads the plane through
FlushDepthPlanes, then writes it from the CPU and tests it with stencil
EQUAL; it fails without the change.

AI-assisted: yes
2026-10-28 18:47:47 +01:00
Darryl Fernandes dd7a9681f2 fix(agc): publish small tiled writes before labels 2026-10-28 18:39:42 +01:00
Adrià bf969dbdbe Merge pull request #11692 from JJenkx/fix/agc-partly-watched-depth-planes
fix(agc): track CPU writes in partly watched depth planes
2026-10-28 15:54:50 +01:00
Adrià 446bd8776c Merge pull request #11465 from valenciana-nc/fix/draw-index-count-overflow
fix(agc): reject quad-list and strip draws whose expanded index count overflows uint32
2026-10-28 15:20:14 +01:00
Romans Pokrovskis b2aad7239c chore: refresh native buffer alias guard after depth write fix 2026-10-28 16:11:13 +02:00
Adrià 26c20975ac Merge pull request #11369 from QRMOE/fix/agc-msaa-depth-buffer-write
fix(agc): release a resident multisample depth before a GPU buffer may write over it
2026-10-28 14:49:09 +01:00
Adrià bd15a91f99 Merge pull request #11696 from Astronaut10/perf/agc-shape-memo
perf(agc): repeat a draw shape's resident targets and pipeline instead of looking them up again
2026-10-28 14:49:03 +01:00
AdriàandClaude Sonnet 5.5 eefa508412 fix(libSceAgcDriver): update the pipeline journal layout guards for ShaderStages::legacyVertex
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-28 13:01:55 +01:00
Get-fix 0bec339021 feat(libSceAgcDriver): draw PS4 (GCN) command buffers
PS4 color and depth targets, PS4 graphics EOP events, and the PS4 tile
modes (1D/2D thin and display, depth with tile split, PRT, linear
general) on the AGC executor, with a GPU detiler for every mode.
Textures sampled over the padded corner of a render target are GPU block
copies, and the PS4 SDK pattern-fill compute kernel runs as a GPU fill
when it repeats one dword, so render targets and HTILE are cleared
without a CPU drain. Two-dword patterns keep running the kernel: as
fills, Limbo's clears of its 64-bit target made its gameplay advance
about half as far per frame.
Tests cover the tiling equations against addrlib formulas, the GPU
detiler for every mode and element size, and the fill ranges.
2026-10-28 13:01:27 +01:00
Dean a8dc96323c Merge pull request #12244 from Tehshortbus/chore/agc-storage-writeback-log
chore(agc): log the storage writeback submit and done lines only with APS5_DEBUG_LOG
2026-10-29 00:28:08 +13:00
Dean 16e1b95117 Merge pull request #11973 from janzezno/fix/overlay-uniform-palette-index
fix(agc): pick the overlay's palette entry with constant indices again
2026-10-28 22:35:43 +13:00
akkadbakkad89 3dcf80b6fe fix(agc): allow MSAA_ENABLE single-sample lines 2026-10-28 09:35:16 +00:00
Dean 5ae16ad52b Merge pull request #11915 from Bram910/fix/pipeline-cache-recovery
fix(agc): recover pipeline cache persistence from transient failures
2026-10-28 22:30:07 +13:00
Adrià a444a18d93 Merge pull request #11507 from hugodearaujo/fix/agc-short-cube-sampling
fix(agc): sample cube descriptors with fewer than six slices as six faces
2026-10-28 10:14:50 +01:00
Cesar MoraandClaude Opus 5.5 91d601ecd0 fix(agc): guard a repeated storage surface over its whole range, as its lookup does
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 08:33:40 +01:00
Cesar MoraandClaude Opus 5.5 2b349ff156 perf(agc): repeat a draw shape's resident targets and pipeline instead of looking them up again
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 08:33:40 +01:00
Dean Galvin 00c06d63e8 Merge branch 'main' into feat/agc-unclamped-normalized-blend-v2
# Conflicts:
#	core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
2026-10-28 20:13:06 +13:00
Dean b99bbebacd Merge pull request #11839 from oneandonlydean/wolverine/agc-driver-micro-perf
perf(agc): reuse context register storage and keep the shadow live-unit count
2026-10-28 20:11:36 +13:00
Dean a734b350f1 Merge pull request #8091 from JJenkx/fix/agc-import-allocation-error-budget
fix(agc): pin the import ceiling only on memory exhaustion
2026-10-28 20:11:23 +13:00
Dean 00e85fea39 Merge pull request #10348 from oneandonlydean/perf-D2-v47
fix(agc): clamp an exported pixel depth to the viewport depth range
2026-10-28 18:25:05 +13:00
Dean ccfb96757f Merge pull request #11307 from dantdmdarealguy/perf/agc-depth-plane-copies-recent-presents
perf(agc): keep recently sampled depth plane copies up to twice the budget
2026-10-28 18:17:14 +13:00
TehshortbusandClaude Opus 5.5 f1af288133 chore(agc): log the storage writeback submit and done lines only with APS5_DEBUG_LOG
writeBackLayers printed "StorageTexture writeback submit" and "StorageTexture
writeback done" unconditionally around the blocking submit of every storage
image writeback. In five GTA V (PPSA04264) runs they were 54 to 978 lines per
run, 5 to 55 % of the log. They now use APS5_LOG_CHARS_OUT_DEBUG, like the
other per-operation lines of the AGC driver, and are compiled out unless
APS5_DEBUG_LOG is defined.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 21:35:22 -07:00