Commit Graph
870 Commits
Author SHA1 Message Date
Yunus Shaikh 1505810fec docs(debt): shorten the native multisampled DCC fast clear entry 2026-10-26 12:30:14 +01:00
Yunus Shaikh 9b0ff5ccc2 fix(agc): accept a compared host import for a multisampled target's FMASK range
be write-watched at the initial import ("native FMASK contents require
watched guest memory") and at each reuse ("native FMASK sampling requires
watched guest memory"). In Linux comparison mode a host import over the
FMASK unwatches it, so the target is refused one check after the color,
DCC and CMASK ranges that the previous commit accepts.

Treat an FMASK range that a compared host import covers
(ComparedHostImportCovers) as the color and metadata ranges are treated:
keep a copy and its NewestStamp at the initial import, skip it in the
import's UnchangedSinceAll, and at reuse require the stamp and the bytes
to be unchanged, comparing them at most once per collect epoch. An
explicitly unwatched FMASK range is still refused.

Four-sample targets take no FMASK range, so this changes nothing for them.

Refs https://github.com/boykopovar/AnyPS5/issues/9724
2026-10-26 12:30:14 +01:00
Yunus Shaikh c10d1eae66 fix(agc): accept a compared host import for an initial multisampled DCC import
Rush 2 Recompiled (PPSA69423) and Wave Race 64 Recompiled (PPSA69424)
stop with "AGC graphics: initial multisampled DCC contents require
watched guest memory"
(https://github.com/boykopovar/AnyPS5/issues/9724). On Linux with
lavapipe, the write-watch probe finds that device accesses to a host
import trip the write watch, so every imported range is compared rather
than watched. A multisampled DCC target whose color, DCC or CMASK range
lies in such an import was then refused at its first draw: importing the
target takes a write generation for each range, and a compared range has
none.

A range that is not watched but lies in a live host import the probe
compares is now copied when the target is imported, and its metadata
again when a whole fill is taken as its fast clear. Each later use
compares the range with that copy, at most once per collect epoch, and
counts any driver or GPU store over its 64 KiB blocks since the copy as
a write, so a guest store of new bytes or any store by the driver
refuses the resident target as a watched range does. A range left
unwatched outside such an import is refused as before.

This covers the Linux comparison mode, not the Windows deferred settle
(BF-150): compared imports on Windows still refuse.
2026-10-26 12:30:01 +01:00
Adrià Franch 8676daa0fc merge: sync archive directories with main 2026-10-26 12:02:23 +01:00
xXPBSXx 599e4d620f Merge remote-tracking branch 'upstream/main' into fix-agc-cb-resolve-packed-float 2026-10-26 11:55:26 +01:00
xXPBSXxandClaude Sonnet 5.5 118e11af13 docs(agc): record the unsupported and unmeasured multisample CB resolve of 11_11_10 float targets
The debt entry for 11_11_10 float color targets covers rendering but not the
resolve. A CB resolve of a multisampled 11_11_10 float source stays refused;
the new entry says that its averaging and rounding are not measured, that no
known source describes them, and that PPSA12361 reaches it (issue #11362).

AI-assisted: yes

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-26 11:55:15 +01:00
joedeangelis533-bot 724a4fcde8 feat(agc): remap unsupported tessellation viewport depth ranges 2026-10-26 06:13:51 -04:00
Adrià FranchandClaude Sonnet 5.5 654eadd7f5 merge: sync archive directories with main
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-26 10:50:37 +01:00
davidamsellemandClaude Opus 5.5 6e5c1f041d docs: name the formats of the gfx1100 type-0 and type-1 measurement
GFX11 renumbers the image formats past 29, so the raw codes 10, 37 and 1
read as other formats on the console's GFX10 numbering (37 is
11_11_10_UNORM there, 2_10_10_10_SNORM on gfx1100). Name them, and say
why the TYPE 9 depth compare control only answers at 32_FLOAT: gfx1100
compares 16_UNORM and 32_FLOAT only and answers zero for the others.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-26 10:43:45 +01:00
davidamsellemandClaude Opus 5 dc81252d64 docs: measure type-0 and type-1 texture descriptors on gfx1100
The entry recorded TYPE 1 only from a gfx1010 measurement with format 22 and left other formats and
depth-compare reads open. Measured on a gfx1100 with the hardware oracle: image_sample_lz,
image_sample_b, image_load, image_sample_c_lz and image_get_resinfo return zero and no fault for
TYPE 0 and TYPE 1 over formats 22, 10, 37 and 1, with a nonzero base over readable memory and with a
zero base. A TYPE 9 control in the same kernel returns the stored texel, the raw dword, the declared
64 and 32, and 1.0 from image_sample_c_lz with an ALWAYS depth compare and format 22.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-10-26 10:43:45 +01:00
Dean b27cc8416f Merge pull request #7505 from AlxcBTW/pr/unwatch-hook-exits-v2
fix(agc): run the unwatch hook before an import whose range leaves the write watch whatever the import does
2026-10-26 21:31:22 +13:00
Dean 9d906c833c Merge pull request #10681 from PYTHONRETARDE/fix/d16-depth-take-storage-discard
fix(agc): discard a new depth surface's depth before taking storage writes
2026-10-26 21:29:52 +13:00
xXPBSXxandClaude Sonnet 5.5 d34c5315de docs(agc): state how the packed 11_11_10 float CB resolve averages
AI-assisted: yes

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-26 09:01:42 +01:00
Dean 204c6747d0 Merge pull request #11197 from LeandroLP23/fix/agc-frame-recorder-settle-before-delta
fix(agc): read a frame capture's memory delta once the accepted submissions completed
2026-10-26 20:48:54 +13:00
Dean Galvin 9e7edf6e0c fix(agc): do not evict host imports used in the current or previous frame
An import was evictable 256 lookups after its last use. A frame makes thousands of lookups, so when the imports a frame uses do not all fit the budget, each new one evicted another of the same frame and the whole set was imported again every frame. A flip packet now ends a frame, and only imports not used in the current or the previous frame are evicted; what does not fit is refused and copied, as below the budget. A frame boundary also expires the remembered evicting refusals.
2026-10-26 20:09:23 +13:00
Dean fdb3925940 Merge pull request #9913 from HQasper/claude/project-thread-75dvwh
fix(agc): draw stencil AND, OR, XOR and XNOR on the bits they change
2026-10-26 20:03:59 +13:00
frankea 37857ceb29 fix(agc): write the console's DRAW_INDEX_MULTI_INST packet for sceAgcDcbDrawIndexMultiInstanced
On a PS5 the builder writes 15 dwords: a tag write of 0xc6000006, opcode 0x3a with its arguments, initiator 0x80 whatever the modifier, and a closing tag write; GetSize returns 60. AnyPS5 wrote NUM_INSTANCES and DRAW_INDEX_2 under argument meanings nothing confirms. The driver refuses 0x3a, whose field meanings are not known, and names it DRAW_INDEX_MULTI_INST as Linux's nvd.h does.
2026-10-25 23:14:39 -04:00
Dean Galvin 72598e34c8 Merge branch 'main' into pr/unwatch-hook-exits-v2 2026-10-26 14:36:49 +13:00
Dean d31f372e33 Merge pull request #10062 from imellag/fix/agc-moltenvk-destroy-at-idle
fix(agc): destroy buffers and memory on MoltenVK only while the graphics queue is idle
2026-10-26 14:28:45 +13:00
qpavyros 9b2dd8dce9 merge: sync archive follow-up with main 2026-10-26 01:53:02 +02:00
Adrià acb900c194 Merge pull request #9737 from imellag/feat/agc-depth-bounds-emulation
feat(agc): emulate a one-sided depth bounds test without the depthBounds feature
2026-10-26 00:35:49 +01:00
qpavyros 6105be4431 merge: sync archive directories with main 2026-10-26 01:10:12 +02:00
LeandroLP23andClaude Opus 5.5 ada20294a6 fix(agc): read a frame capture's memory delta once the accepted submissions completed
A delta read its blocks with ReadCommittedUnsynced while GPU work
accepted before the call could still write them, so a capture could
hold a block from before a DMA copy that the replay then wrote back over
the copy's result. A delta with blocks to read now waits up to 10 s for
the accepted submissions and records the serials after the wait; the
capture stops with a warning when the work does not finish. The Windows
quarantine of agc_driver_frame_replay is removed.

Fixes #10711

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 22:36:36 +01:00
Adrià cceb6c3c41 Merge pull request #9961 from daviaaze/fix/agc-dcc-sliced-array-window
fix(agc): serve sampled DCC array views from their viewed slices
2026-10-25 21:53:47 +01:00
thuanquang 6adad6733c Merge main into fix/linear-target-import-creation 2026-10-26 02:07:34 +07:00
Adrià 5d48c6233e Merge pull request #9401 from tibzejoker/perf/grow-pipeline-store
perf(agc): size the pipeline store to the title's working set
2026-10-25 19:07:59 +01:00
slopgobblercobbler dbfde882dd fix(agc): validate multi-submit count overflow and null command buffers 2026-10-25 18:20:45 +01:00
Davi Azevedo b166232c72 fix(agc): refresh DCC sampled array windows 2026-10-25 14:13:27 -03:00
Eduardo Ruiz f1fb9d6eaf fix(agc): select the first level of a single-level depth view
A DB_DEPTH_VIEW.MIPID above zero on a surface with DB_Z_INFO.MAXMIP zero selected no level and threw. Flashback sets it while it renders the six slices of a single-level 128x128 Z_X depth array, so the field cannot select another level; decode the first one as the console does.
2026-10-25 18:03:07 +01:00
Dean 79f061ba5b Merge pull request #9685 from thuanquang/fix/linear-target-completion-stores
fix(agc): store resident linear color targets at completion points, limited to their drawn rectangles
2026-10-26 05:44:21 +13:00
Adrià 0658bc8749 Merge pull request #9186 from fma-rc/fix/agc-retire-undrawn-filled-msaa
fix(agc): retire an undrawn filled multisampled color target that a guest access overlaps
2026-10-25 14:25:07 +01:00
Adrià a8b199d103 Merge pull request #7618 from mrfelek/perf/stage-swept-write-only
perf(agc): stage written-only buffer elements a dispatch sweeps on discrete GPUs
2026-10-25 13:19:08 +01:00
Adrià 3eb0770ae9 Merge pull request #9361 from thuanquang/docs/debt-sweep-agc-cb-passes
docs(agc): correct multisampled DCC acceptance in the CB passes debt entry
2026-10-25 11:46:13 +01:00
Adrià ce29789faa Merge pull request #9352 from thuanquang/docs/debt-force-degamma-variant-names
docs(agc): name the 10_11_11 and 2_10_10_10 variants that FORCE_DEGAMMA leaves unchanged
2026-10-25 11:40:07 +01:00
Adrià 8e9cadc1fe Merge pull request #9275 from xXPBSXx/docs-agc-storage-image-uncommitted
docs(debt): record the storage image refusal over uncommitted guest memory
2026-10-25 11:37:52 +01:00
Adrià acbfd7c7fe Merge pull request #9941 from EagleBearerYS/fix/agc-sync-settle-initial-dcc-main2
fix(agc): settle a pending import synchronously before an initial multisampled DCC import
2026-10-25 10:50:05 +01:00
Adrià f4f1160614 Merge pull request #9670 from winstrex/perf/agc-present-queue
perf(agc): present on a queue of its own outside the GPU mutex
2026-10-25 10:28:27 +01:00
milescovielloandClaude Opus 5.5 a06c589ea6 docs(agc): shorten the tessellation-geometry debt entry
The entry was over the 1000-character limit the conventions check
warns about. Same content, tighter wording.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 08:32:48 +00:00
milescovielloandClaude Opus 5.5 cd5fc9e838 feat(agc): draw tessellation followed by an NGG geometry stage
Crimson Desert (PPSA25286) draws with VGT_SHADER_STAGES_EN 0x60212d:
local, hull, domain and NGG geometry stages, the hull halves merged in one
registered type-3 program, the domain and geometry halves in one type-2
program. The domain half runs as the tessellation evaluation stage and
captures each vertex's ESGS item, and a mesh shader runs the geometry half
on the captured items.

Registered type-3 merged hulls come from #6679; this adds 16-bit LDS
reads and writes in tessellation stages, which Crimson Desert's merged
hull uses.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 08:32:37 +00:00
Adrià 1240b5da19 Merge pull request #9597 from milescoviello/fix/mipmapped-dcc-target-keys
fix(agc): keep a mipmapped DCC color target's keys on its resident image
2026-10-25 09:29:51 +01:00
Yunus Shaikh 2cbcc0e2e6 docs(libSceAgcDriver): list the Export.cpp declarations without a prototype 2026-10-25 07:44:54 +00:00
Adrià 811ffe10af Merge pull request #9514 from EagleBearerYS/fix/agc-address-copy-evict-main
fix(agc): an address-based build evicts idle imports instead of copying past the cap
2026-10-25 08:40:37 +01:00
slopgobblercobbler f23ef99699 feat(libSceAgcDriver): cover payload packing in sceAgcDriverNopDataWritePacket 2026-10-25 02:36:47 +01:00
xXPBSXxandClaude Sonnet 5.5 c1d485930a docs(debt): note how a title handles the result of sceAgcDriverRegisterDefaultOwner
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-25 02:17:10 +01:00
milescovielloandClaude Opus 5.5 52f36c8aa2 fix(agc): keep a mipmapped DCC color target's keys on its resident image
DecodeColorBuffer dropped the DCC address of a color target with more than
one mip, so the target's resident image had no keys: it was uploaded from
guest memory under the game's fast-clear keys, and no draw into it marked
them uncompressed. The game's textures over the same chain name the keys,
so they kept sampling the clear (0000 reads as (0,0,0,0)) whatever was
drawn. MXGP 26, Borderlands 4 and Forspoken render such targets.

- ColorTarget.chainDccAddress keeps the keys of a 2D single-layer chain;
  dccAddress stays 0, so the per-draw single-mip key handling is unchanged.
- SurfaceForTarget gives the resident surface those keys, and the image
  then treats them as a multi-mip storage image does: a uniform clear is
  cleared on the GPU at upload, and the first write marks every key
  uncompressed.
- A draw recipe's key check uses the surface's keys.
- sizeof(State) is 840: the recipe codec and CanonicalPipelineState do not
  copy the field.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 00:31:53 +00:00
thibautandClaude Opus 5.5 ad047899bb perf(agc): grow the pipeline store from 1024 up to 4096 entries
The graphics pipeline store kept a fixed 1024 entries and the pipeline journal replayed at most
1024 records, and a replayed pipeline that found the store full was dropped. A title whose
working set is larger rebuilt the rest at the draw on every run, and evicted pipelines it kept
using were rebuilt again and again.

The bound now starts at 1024 and doubles up to 4096: a journal replay that does not fit grows it
instead of dropping the pipeline, and so does eviction churn (a ghost list of evicted keys, checked
every bound/32 evictions: more than half of them came back). It never shrinks during a run;
APS5_PIPELINE_STORE_ENTRIES still fixes it. The journal loads its last 4096 records by default
(APS5_PIPELINE_JOURNAL_ENTRIES). Resident pipelines are bounded by count, not bytes.

agc_driver_recorder_tests --benchmark-pipeline-store-memory [count] (opt-in, not registered)
builds count graphics pipelines with one fragment module each through CachedPipeline and prints
process private bytes and VK_EXT_memory_budget heap usage before and after: with the triangle
shaders about 59 KiB host and no device memory per pipeline on an RTX 4090, 100 KiB host and
8 KiB device-local on a UHD 770.

Tests: agc_pipeline_store_growth (fails on main), agc_pipeline_store_fixed_bound,
agc_pipeline_store_replay_growth (replays on one thread: the mock Vulkan is not thread-safe).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017SNUYRd7sRKZrMYpquAsnU
2026-10-25 02:02:41 +02:00
Dean Galvin f139561693 Merge main into fix/linear-target-completion-stores 2026-10-25 12:57:20 +13:00
Dean Galvin a5e015f7b7 Merge main into fix/linear-target-import-creation 2026-10-25 12:56:51 +13:00
Adrià Franch b6bfc78286 docs(agc): keep main's stencil replay debt line 2026-10-24 22:41:08 +02:00
fma-rc a8706b22ba docs(agc): record when an undrawn multisampled target is retired on guest access 2026-10-24 22:41:08 +02:00