Commit Graph
3842 Commits
Author SHA1 Message Date
11d145855e fix(shader): keep the literal word of a GCN s_setreg_imm32_b32
The SOPK branch of the GCN decoder never set the literal for
s_setreg_imm32_b32, so the eight-byte instruction was re-encoded as one
word and its decode threw "literal operand word is out of the code span
bounds". The decoder now copies the literal for that opcode; the new
agc_gcn_decode test decodes the reported stream.

Co-authored-by: javierUDP <[email protected]>
Co-authored-by: Savvanis Spyros <[email protected]>
2026-10-22 12:17:44 +03:00
Get-fix 4b717912d7 feat(shader): decode PS4 (GCN) shaders by re-encoding them to RDNA
Each GCN instruction is re-encoded to its RDNA form and decoded by the
existing RDNA decoder, so the PS4 path shares the recompiler. Covers the
legacy VS stage (program at the VS slot, user SGPRs from s0, vertex and
instance index in v0-v3), fetch shaders linked as user-data calls, MIMG
(image_sample and friends), PS4 buffer descriptors (GCN DATA_FORMAT /
NUM_FORMAT, 44-bit base) and T# image descriptors (GCN tiling in word 7).
The GCN switch is keyed into the shader disk cache. PS5 behaviour is
unchanged: every PS4-only rule is gated on GcnGuestShaders().
2026-10-22 12:17:44 +03:00
Dean 7e2ba73e4c Merge pull request #7961 from milescoviello/fix/copied-region-transfer-src
fix(agc): give copied guest buffer regions transfer-source usage
2026-10-22 21:19:52 +13:00
Dean 865e06f1bc Merge pull request #7927 from whamre/feat/agc-depth-mips
feat(agc): render into depth mip levels
2026-10-22 19:09:06 +13:00
Adrià 5a79f26450 Merge pull request #9647 from adriadam10/fix/main-pipelined-indirect
fix(main): the blocker of agc_driver_pipelined_indirect_draw outlives its test
2026-10-22 08:01:19 +02:00
Adrià FranchandClaude 0b3581b387 fix(main): the blocker of agc_driver_pipelined_indirect_draw outlives its test
#9433 merged red: main's push build 39725502001 failed
agc_driver_pipelined_indirect_draw with "the queue worker and the draw pipeline
deadlocked" (the failure predates #8807, whose diff only touches the frame dump
writer; the test's timing was never robust).

Cause: the Blocker queued on the draw pipeline captured `this`, a stack
object. The first test's Finish() can return before the blocker lambda has
run, so it ran during the second test through a dangling pointer, read a
`release` that was never set, and held the committer forever. Reproduced
under CPU starvation (12 processes on 2 cores, lavapipe, no udmabuf): ~17% of
runs failed, 0 of 72 hang after the fix.

The blocker state is now shared and the tests wait for the blocker to finish;
the fixed 500 ms sleeps wait for the pipeline items and the drain instead.

Co-Authored-By: Claude <[email protected]>
2026-10-22 08:00:59 +02:00
Werner 74f2fcb612 fix(agc): refuse a depth view mip on a surface without mips
AI-assisted: yes
2026-10-22 07:37:59 +02:00
Dean 4a17c71757 Merge pull request #8310 from dantdmdarealguy/fix/agc-array-window-texel-alignment
test(agc): align the array window test's texels at run time
2026-10-22 18:30:27 +13:00
Adrià 0c6a5bd593 Merge pull request #8519 from MarrasFederico/fix/agc-zero-stride-oob-select
fix(agc): follow RDNA 2's range checks for zero-stride vertex fetches
2026-10-21 21:54:30 +02:00
Adrià 415fd7136b Merge pull request #8991 from Tamalero/fix/shader-image-table-split-tsharp-halves
fix(recompiler): match image-table T# halves offset before and after readfirstlane
2026-10-21 21:53:27 +02:00
Dean 584c5a80fd Merge pull request #6718 from Zenodeon/stk-resource-performance-pr
perf(agc): avoid redundant texture-array CPU transfers
2026-10-22 08:30:01 +13:00
Adrià f0de89a506 Merge pull request #9026 from milescoviello/perf/depth-plane-unit-stores
perf(agc): store only the depth plane units a read overlaps
2026-10-21 21:29:26 +02:00
Adrià 1698d1ea6a Merge pull request #8642 from MarcZX10/codex/color-compare-format-support-7934
fix(agc): match measured color comparison formats
2026-10-21 21:02:30 +02:00
Adrià FranchandClaude 78178e940e test(recompiler): drop code comments from split waterfall image table test
Co-Authored-By: Claude <[email protected]>
2026-10-21 20:21:43 +02:00
TamaleroandClaude Opus 5.5 9998385047 fix(recompiler): match image-table T# halves offset before and after readfirstlane
A T# loaded as two s_load_dwordx4 halves from a pointer table, where the
second half's offset is formed per lane (v_lshl_add_u32 key, 5, 16) before
v_readfirstlane and the first half's after it (readfirstlane(key) << 5),
was refused: the second half's +16 sat inside ReadFirstLane(Select(exec,
..., old), exec), so TryMakeTableColumn saw a different base and a zero
addend. Compare such offsets in a first-lane normal form (lane value, mask,
shift, addend), peeling selects the mask implies as the SRT walker already
does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 20:21:35 +02:00
Federico Marras bea48f5ee0 test(agc): keep the zero-stride render-target alias check on a fetch that reads 2026-10-21 20:16:30 +02:00
Federico Marras 58afce1ad1 fix(agc): follow RDNA 2's range checks for zero-stride vertex fetches 2026-10-21 20:16:30 +02:00
Adrià d27d05ec14 Merge pull request #7883 from thuanquang/fix/strip-last-provoking-gs
fix(agc): draw triangle strips through a geometry program with the last provoking vertex
2026-10-21 20:10:30 +02:00
Adrià eb6928696a Merge pull request #7984 from fisherjoey/fix/idle-publish-wait
fix(agc): wait for the idle flush's unit-shadow publish before returning
2026-10-21 20:10:04 +02:00
Adrià 3897c5c6bd Merge pull request #7849 from MarcZX10/codex/fix-host-import-partial-unmap-lifetime
fix(agc): retire host imports before range cuts
2026-10-21 20:09:59 +02:00
Adrià 5fe3a62644 Merge pull request #7981 from fisherjoey/fix/import-window-digests
fix(agc): hash the pages of an import window instead of copying them
2026-10-21 20:05:58 +02:00
Adrià 95d17687ae Merge pull request #8267 from thuanquang/fix/amd-robust2
fix(agc): give AMD's proprietary driver robustBufferAccess2 again
2026-10-21 19:59:43 +02:00
Adrià 9c437e8087 Merge pull request #7629 from EagleBearerYS/fix/agc-settle-alias-before-import-free
fix(agc): destroy settle aliases before their imports are freed
2026-10-21 19:57:39 +02:00
Adrià 60976d8a4a Merge pull request #7827 from MarcZX10/codex/fix-lds-split-before-allocation-7794
fix(agc): refuse LDS split before allocation
2026-10-21 19:55:16 +02:00
Dean 99844c7eef Merge pull request #8762 from JJenkx/fix/sparse-heap-existing-import
fix(agc): prefer imported prefixes before sparse heap mirrors
2026-10-22 06:22:49 +13:00
Dean 4ec064d29b Merge pull request #6887 from Amoenus/codex/test-msaa-reader-retile-main143
test(agc): connect MSAA sample readback to tiled layouts
2026-10-22 06:14:29 +13:00
MarcZX10 c566d31d1f test(agc): skip reimport bench below host budget 2026-10-21 16:53:05 +00:00
Dean d34da5d694 Merge pull request #7725 from milescoviello/fix/stencil-known-replace
fix(agc): draw a stencil replacement against a known stencil value as an inversion
2026-10-22 05:49:29 +13:00
MarcZX10 fa8115ce63 test(agc): assert whole import retires on middle unmap 2026-10-21 16:42:05 +00:00
MarcZX10 2a12152f2b test(agc): clarify imports after partial unmap 2026-10-21 16:42:05 +00:00
MarcZX10 a9b14023dd fix(agc): retire host imports before range cuts 2026-10-21 16:42:05 +00:00
thuanquangandClaude 0bd8f6188a fix(agc): draw triangle strips through a geometry program with the last provoking vertex
An RX 6700 XT hands a geometry shader odd strip triangle i as
(i+1, i, i+2) with the last provoking vertex, which is the order the
translator already uses, and since #7374 last mode takes the flat
outputs of the program's primitives from their last index. Keep the
last-mode refusal for fans only, which reach the program as
(i+1, i+2, 0) while the hardware gives (0, i+1, i+2). TEKKEN DARK
RESURRECTION (PPSA31371) stops on such a strip draw.

Co-Authored-By: Claude <[email protected]>
2026-10-21 21:41:01 +07:00
Dean 2c4b116da9 Merge pull request #7729 from milescoviello/fix/one-sample-depth-iter
fix(agc): draw a PS_ITER_SAMPLE program once per pixel into a one-sample depth target
2026-10-22 03:14:54 +13:00
Romans Pokrovskis b65a553db6 test(agc): retile distinct D32 sample readback 2026-10-21 16:10:59 +03:00
Romans Pokrovskis ab1e6a7a89 test(agc): connect multisample readback to R_X and Z_X retile 2026-10-21 16:10:59 +03:00
Romans Pokrovskis b4fbf24d1e feat(agc): upload individual multisample image samples 2026-10-21 16:06:59 +03:00
Romans Pokrovskis b8297adab9 feat(agc): add fragment-preserving R_X and Z_X layouts 2026-10-21 16:06:32 +03:00
Dean 745b394629 Merge pull request #9102 from oneandonlydean/fix/storage-write-back-no-window-unmap
test(agc): unmap only the no-window test's own tail
2026-10-22 02:00:39 +13:00
Dean fdf22f9546 Merge pull request #7911 from savvaniss/fix/agc-release-mem-system-counter
fix(agc): name the RELEASE_MEM system counter instead of GDS data
2026-10-22 01:54:27 +13:00
Dean ce7d547175 Merge pull request #8856 from klosixgaming-arch/feat/agc-point-list-geometry-output
feat(agc): draw point-list output of NGG geometry programs as mesh points
2026-10-22 01:46:18 +13:00
Dean 0c83831421 Merge pull request #8975 from milescoviello/rebase/5499-db-depth-copy
feat(agc): run DB depth copies into a single-sample R32 float target
2026-10-22 01:20:22 +13:00
Dean Galvin 2050c88eed test(agc): unmap only the no-window test's own tail
The guest block's tail trim unmapped begin + bytes + UnitBytes - aligned bytes from the end of the block, which runs past the mapping it made. Trim begin + UnitBytes - aligned, as the sibling tests do.
2026-10-22 00:35:08 +13:00
Savvanis Spyros 123768abcd Merge branch 'main' of https://github.com/boykopovar/AnyPS5 into fix/agc-release-mem-system-counter
# Conflicts:
#	docs/dev/debt/libSceAgcDriver.md
2026-10-21 14:15:53 +03:00
Adrià 98145b48d8 Merge pull request #7426 from DavidSamir/feat/shader-barycentric-tessellation-last-vertex
feat(agc): draw the last provoking vertex through the barycentric tessellation stages
2026-10-21 13:08:47 +02:00
Adrià 2cca5c0fd6 Merge pull request #7600 from milescoviello/feat/msaa-dcc-comp-to-single
feat(agc): take RADV's comp-to-single clear of a multisampled DCC target
2026-10-21 13:07:42 +02:00
Adrià 27fabb6b7d Merge pull request #7869 from savvaniss/feat/agc-polygon-mode
feat(agc): draw point and line polygon modes
2026-10-21 12:48:05 +02:00
67cea1c314 test(agc): refuse a DB depth copy from a depth surface the device cannot sample
On a device that cannot sample two-sample depth, as lavapipe, the DB
depth copy case now also creates a two-sample surface and expects the
copy's sampling refusal, so that refusal is covered where it applies.
Devices that sample two-sample depth skip it.

Co-authored-by: simonbbby <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 10:27:24 +00:00
Joey Fisher ed921e225f fix(agc): hash the pages of an import window instead of copying them
ImportWatched kept a copy of every non-zero page of the range being imported, so that a page the
write watch reported during the import could be told from one that still held its bytes. The copy
had the range's footprint: a first import of a 0.5-3 GiB guest heap held that much host memory
while it ran.

The window now keeps a 64-bit digest per 4 KiB page (four xxHash64 lanes) and compares digests:
8 bytes per page, 1/512 of the range. Same decision for every page, same reads of guest memory.

CheckImportWindowFootprint imports a 64 MiB watched range and requires the heap held during the
import to stay under 1 MiB. It failed with "held 64 MiB" before this change.
2026-10-21 04:13:49 -06:00
Joey Fisher db3af40970 fix(agc): wait for the idle flush's unit-shadow publish before returning
The idle flush (VulkanDevice::StoreIdleResults) publishes the unit shadows over guest memory into
the host import and only submits the copies. publishUnits picks the units to store on the CPU,
and the slab -> import copy lands when the GPU runs it, so a guest store made between the two is
overwritten with the older shadow bytes. The memory-access hook waits through SyncThrough right
after its flush; the idle flush has no reader that waits.

FlushPending and PublishShadowsOnly now sync the recorder under the GPU mutex after an idle
publish that stored units. Other flush reasons are unchanged.

Test: agc_idle_publish_wait (a CPU store made after the idle flush returns survives; a label
flush's publish stays recorded).
2026-10-21 04:13:42 -06:00
milescovielloandClaude Opus 5.5 7bf7be589d test(agc): cover range-limited depth plane stores
DepthPlanePartialStore draws depth 0.5 into a 384x200 D32 Z_X plane (3x2
64 KiB tiles, the last row 72 texels high) over memory filled with 1.0 and
checks the plane's memory unit by unit:

- a read ending 3 KiB into the plane stores unit 0 alone (one store, one
  unit, 64 KiB counted) and leaves the plane stale; the same read again
  stores nothing;
- a read of the whole plane stores the other five units, the edge tiles
  holding 128x72 depth values with their padding left as it was;
- a guest write into unit 4 after unit 0 was stored wins in unit 4 only:
  a later whole read stores the four other stale units over 1.0, and a
  LESS draw at 0.6 passes exactly over unit 4 (the plane-wide generation
  synced every unit from memory instead);
- the retire of a surface the guest wrote into, through a view with two
  levels, stores its stale units the guest did not write;
- a color target over unit 5 retires the surface after storing units 1-4;
- over unwatched memory a partial store leaves the other units on the GPU,
  so a LESS draw at 0.6 passes nowhere.

TextureTiling checks that the 64KB Z_X equation of 4-byte elements reads
only x and y bits below 7, so each 64 KiB unit of a 3840x2160 D32 plane is
exactly one 128x128 tile.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 10:03:00 +00:00