Commit Graph
2247 Commits
Author SHA1 Message Date
Dean 3fea2a937b Merge pull request #11685 from oneandonlydean/port/direct-depth-layer-copy-v2
feat(agc): copy depth planes to and from color storage images directly where maintenance8 allows
2026-10-27 23:03:00 +13:00
Dean a636927e5f Merge pull request #8161 from Celegans12/feat/tools-ab-split
feat(tools): split the periodic reports of an APS5_AB run by phase
2026-10-27 21:34:47 +13:00
Adrià 49f600f12c Merge pull request #11142 from imellag/perf/agc-moved-words-upload
perf(agc): copy moved draw words into the draw upload ring
2026-10-27 09:19:12 +01:00
Dean 36e6c092c0 Merge pull request #9011 from JJenkx/perf/mapped-readable-run-lease-b5d763
perf(agc): lease mapped readable runs for import events
2026-10-27 21:05:23 +13:00
Adrià 83370fe136 Merge pull request #11065 from morten-holm/fix/agc-mesh-limit-details
fix(agc): name the mesh limit a pipeline exceeds and its values
2026-10-27 08:54:07 +01:00
Adrià 76dec1794b Merge pull request #8998 from MarcZX10/codex/f32-image-store-rtz-8282
fix(agc): round 16-bit float image stores toward zero
2026-10-27 07:59:23 +01:00
Dean 9260711d01 Merge pull request #9694 from Tamalero/fix/agc-metadata-pass-coverage-without-metadata
fix(agc): require full coverage only for metadata pass targets with CMASK or DCC keys
2026-10-27 18:20:38 +13:00
Dean 1764e016f8 Merge pull request #9050 from EagleBearerYS/fix/agc-moved-buffer-render-target-cut
fix(agc): size a moved read-only buffer at the render target as its build does
2026-10-27 18:19:07 +13:00
Dean a0cf4c4d23 Merge pull request #8913 from Celegans12/perf/agc-pool-exact-size-hit
perf(agc): prefer a pooled buffer of the requested exact size
2026-10-27 18:18:50 +13:00
Adrià 4297464b12 Merge pull request #9402 from janzezno/perf/incremental-import-refresh
perf(agc): re-check only the host imports a registry change can reach
2026-10-27 06:10:48 +01:00
Adrià f5e3dc5e3b Merge pull request #10676 from imellag/fix/agc-libcxx-build-macos
fix(agc): build the pending image snapshot and the queued index read order test with Apple's libc++
2026-10-27 05:45:00 +01:00
Adrià 4c486ca322 Merge pull request #10515 from JJenkx/fix/agc-two-sample-dithered-a2c
fix(agc): emulate two-sample DB_ALPHA_TO_MASK 0xe701 dithered alpha-to-coverage
2026-10-27 04:52:02 +01:00
Dean 9da50eb84a Merge pull request #11148 from EagleBearerYS/fix/agc-failed-join-import-owner
fix(agc): write back a view whose space import a failed join retired
2026-10-27 15:00:59 +13:00
Dean 1223406b0b Merge pull request #10696 from Amoenus/codex/fix-import-upload-generation-main29f539-20261024
fix(agc): collect upload generation after host import
2026-10-27 14:59:40 +13:00
Dean c831db72df Merge pull request #9521 from Raghav314/fix/agc-idle-cpu-writebacks
fix(agc): store idle write-backs and publishes on the CPU at completion, keeping blocks the guest wrote in flight
2026-10-27 14:58:03 +13:00
Dean 22a8590492 Merge pull request #9202 from thuanquang/perf/linear-target-scissor-rows
fix(agc): store only the bytes a synchronous draw changed in a linear color target
2026-10-27 14:57:46 +13:00
Dean 37c6b4bc25 Merge pull request #8077 from 0xcrstn/ufc6/descriptor-web-fold
fix(shader): split descriptor webs whose paths fold or hold invalid arms
2026-10-27 14:56:47 +13:00
Dean d1de04f943 Merge pull request #7484 from AlxcBTW/pr/robust-loads
perf(recompiler): leave the descriptor-range comparison out of direct buffer loads when the device zeroes past the range
2026-10-27 14:56:32 +13:00
Dean 630211a866 Merge pull request #6612 from milescoviello/feat/tess-geometry
feat(agc): draw tessellation followed by an NGG geometry stage
2026-10-27 14:56:18 +13:00
Dean 8b2ae8a578 Merge pull request #6249 from Ondra97/codex/fix-copy-alias-byte-coverage
fix(agc): preserve all bytes in image-backed buffer copies
2026-10-27 14:56:03 +13:00
MarcZX10 4a25a6560c fix(agc): bind UINT views for multisample float stores 2026-10-26 23:52:45 +00:00
MarcZX10 027c6f06a8 fix(agc): bind UINT views for float16 image stores 2026-10-26 23:52:24 +00:00
Dean 74acfad65b Merge pull request #11365 from oneandonlydean/sa/per-draw-gpu-timing
feat(agc): opt-in per-draw GPU timing and dump-by-address diagnostics
2026-10-27 11:08:24 +13:00
Dean f1ba9f5f3e Merge pull request #10150 from milescoviello/fix/share-table-rejection-messages
fix(agc): share a table's rejection messages instead of copying each
2026-10-27 10:53:42 +13:00
Dean 910e14f3c9 Merge pull request #8896 from teepean/perf/recent-host-imports
perf(agc): find a host import among the last ones found first
2026-10-27 10:52:34 +13:00
janzezno 4f7e51f399 perf(agc): re-check only the host imports a registry change can reach
refreshImports checked every live host import, failure and refusal
again at each guest allocation registry change. A title that maps
memory often (SuperTuxKart, ~1650 maps a second) paid a walk that grew
with the live imports: ~34 FPS with ~1.1 GiB of imports on RADV.

The import table now keeps a weak_ptr snapshot of the ranges it was
last checked against and diffs it with the new lease. Only imports
whose import window touches a changed span, and imports made since the
last refresh, are checked again. Every import is checked when the window
is 0 or the window or budget changed. SuperTuxKart's menu goes from
~34 to ~45 FPS with the same imports live.
2026-10-26 21:19:58 +01:00
Yunus Shaikh b1889783be feat(agc): fill the overlay's second page from the driver's counters
Page 2 now samples its sources once a second, in NotePresent, while it
shows; nothing of it runs while the overlay is hidden or on page 1.

- Busy share per queue worker, the top 5 phases in ms per frame and queue
  0's waits (memory, lock, GPU) come from the trace's per-thread totals.
  Showing page 2 turns recording on with buffering off, so a timed scope
  only adds to its thread's totals; leaving it turns recording off again.
  Toggle switches it under a mutex, and ANYPS5_OVERLAY=2 switches it on at
  start. An APS5_TRACE_* run keeps its own recording untouched, and page 2
  then shows these lines only while that trace records. A driver thread
  names itself when it starts (BindThread without APS5_TRACE_* stores the
  name only) and binds on its first timed scope while page 2 shows;
  unnamed threads are not bound.
- Render passes per frame: the draw path counts a begun pass in the trace
  totals while page 2's totals are on (PerformanceTrace::Count).
- Flips/s and the draw cache's hit rate come from the driver through a
  source it registers at start (the draw cache's lock is only tried); the
  pipeline store's hit rate from PipelineStoreTotals; the compile backlog
  from the shader preparation and library prebuild pools (tried locks).
- Dropped frames per second are the presents that found no free swapchain
  image; repeated ones are presents of the display buffer shown just before.
  The device passes the buffer's address, its present mode and the drops.
- Commit charge against the commit limit: GetPerformanceInfo on Windows,
  Committed_AS and CommitLimit from /proc/meminfo on Linux; page faults per
  second from PageFaultCount or getrusage.
- Host imports: their count and bytes against the budget, on devices that
  import host memory.
- CPU copies: address-based builds count the bytes they copy in a
  per-thread counter (a relaxed load and store, folded once a second) with
  the largest build of each second against the address-copy cap.
- Unimplemented-function calls: libc counts NotImplemented_nid_no_patch
  calls; refused shaders are the APS5_SKIP_REFUSED_DRAWS set's size.
- Title ID (when the title has a param.json) and present mode.

The tests cover the trace deltas, hit rates, present-mode names, the
/proc/meminfo parser and the OS reads, the per-thread copy counter's fold,
the counted unimplemented call, the trace switch with page 2 and lazy
binding without buffering, and on lavapipe the sampler end to end with a
fake driver source, its reset when page 2 is left, and the cost of a
present hidden, on page 1 and on page 2.
2026-10-26 20:42:29 +01:00
Dean Galvin 9b31471555 feat(agc): copy depth planes to and from color storage images directly where maintenance8 allows
A depth plane and the color storage image that holds or receives its texels were copied image to buffer, then buffer to image. With VK_KHR_maintenance8, which the device already enables, vkCmdCopyImage copies the depth aspect directly to and from a single-component color format of its size (D32 with R32, D16 with R16), so those copies record one image copy and two barriers in place of the staging buffer round trip and three barriers. TakeStorage keeps its discard of the new depth surface before the copy. 24-bit depth, the stencil plane and every other format pair keep the buffer path, as does APS5_NO_DIRECT_DEPTH_COPY=1. The graphics Context now carries the maintenance8 flag. No performance claim is made.
2026-10-27 08:40:41 +13:00
Dean Galvin 09334e1ac5 Merge remote-tracking branch 'up/main' into sa/per-draw-gpu-timing 2026-10-27 08:24:46 +13:00
Dean 263eee0a77 Merge pull request #10837 from Raghav314/perf/agc-depth-plane-copies
perf(agc): keep depth plane copies resident instead of remaking them on each use
2026-10-27 08:18:34 +13:00
Dean 930a681f2a Merge pull request #9879 from thuanquang/fix/linear-target-import-creation
perf(agc): create the host import of a linear color target in registered memory
2026-10-27 08:18:22 +13:00
Romans Pokrovskis 7191aef004 Merge commit '48c160c58b589157ebd94ebd53736a182f8303bf' into codex/refresh-pr10696-main48c-20261026 2026-10-26 19:16:19 +02:00
Adrià 035ac96edd Merge pull request #9940 from EagleBearerYS/fix/agc-compared-import-initial-dcc
fix(agc): accept a compared host import for an initial multisampled DCC import
2026-10-26 13:51:02 +01:00
0xcrstnandClaude Opus 5.5 ec06ba2973 fix(agc): read back descriptor faults of shaders that also use image tables
A shader with an image table map read its fault buffer back only when a
table record was poisoned, an SRT read was poisoned, it had window lane
guards or the loop guard was on. A DescriptorFault only set the fault
buffer, so with a valid table and no copied write nothing ran the fault
check, and a lane that took a folded descriptor web path or selected an
undefined arm read arm 0 or zeros with no report.

The compiled artifact now counts its DescriptorFault instructions
(descriptorFaults, stored in the shader disk cache, format 48), and the
readback gate requests the fault check when it is nonzero. The result a
capture materializes copies the count, and also windowLaneGuards, which
that copy had dropped, so the gate's window lane guard condition never
saw it. sizeof(CompiledShaderArtifact) is 288 and sizeof(RecompileResult)
552 with the new field.

agc_driver_descriptor_web_faults adds a wave32 shader that reads an image
table and then the descriptor web, storing only to LDS so no copied write
forces completion: it binds an image table and no BDA address table, a
valid arm and an unselected undefined arm stay clean, the folded path and
a selected undefined arm fault at the read, and nothing faults with EXEC
empty. Without the gate change the folded case does not fault.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 14:46:11 +02:00
Dean 9bbb7f37c6 Merge pull request #8898 from camezaro-intc/format11-11-10-float-stores
fix(shader_recompiler): pack format 11_11_10 float image stores in shader
2026-10-27 01:03:40 +13:00
Adrià 6641f48356 Merge pull request #9789 from rooklz/fix/agc-uint-color-export
fix(libSceAgcDriver): export raw 32-bit values into UINT color targets as integers
2026-10-26 12:48:04 +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
Celegans12 3cf8170ff8 feat(agc): toggle runtime switches in alternating phases of one run
Two runs of the same scene drift apart by more than many effects worth
measuring. APS5_AB=<seconds>:<switch>[+...] alternates phase A (switches
as the environment sets them) and phase B (the listed switches toggled)
at flip packets, under the GPU mutex after the draw pipeline drained,
and prints "[ab] phase A|B <k> begins/settled at present <n> (t <s> s)".
APS5_AB_START (a flip count, or <n>s) delays the first phase and
APS5_AB_SETTLE (default 2 s) marks when a phase's reports are clean.
Switches live in a registry (RuntimeSwitches) of relaxed atomics that
start as the environment sets them; APS5_NO_BARRIER_BATCH is the first,
since every elision it gates is decided per barrier. Any other name
fails the first flip. Without APS5_AB nothing changes.

AI-assisted: yes
2026-10-26 12:26:04 +01:00
Dean Galvin e0bd61fae2 Merge branch 'main' into pr/robust-loads 2026-10-26 23:10:10 +13:00
Dean Galvin 8c45681cc3 fix(agc): join gputime keys to drawvariant ids and name queued draws
The [gputime] line printed a draw's range key with the draw flag still set, so an ordinary variant id 0x2 appeared as 0x8000000000000002 next to [drawvariant] 0x2. A draw's key now comes from Recorder::DrawTimingKey and the line prints it through Recorder::TimingKeyLabel as "draw 0x2", the id [drawvariant] names.

The [drawvariant] line was only printed when a draw was recorded inline, so a queued draw's first-seen variant had a timing range with no address line. It is now printed before the draw is handed to the pipeline.

The APS5_PROFILE_GPU_DRAWS row states the label, the shared per-batch query cap and that draws using a recipe are not timed.
2026-10-26 22:33:53 +13:00
Dean Galvin 809914084f Merge main into sa/per-draw-gpu-timing 2026-10-26 22:33:43 +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
Dean 19af7f44e4 Merge pull request #10368 from Ondra97/codex/fix-storage-native-overlap-span
fix(agc): check whole storage views for native surface overlap
2026-10-26 21:20:04 +13:00
SP4C3B4R-8 631f77e696 perf(agc): time each recorded draw on the GPU by its fragment program
Opt-in with APS5_PROFILE_GPU_DRAWS=1 together with APS5_PROFILE_GPU=1: a [gputime] range around each recorded draw command keyed by the fragment program's variant id, and a [drawvariant] line naming the code address behind each variant id once.
2026-10-26 20:10:08 +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
milescovielloandClaude Opus 5.5 004f49875e fix(agc): keep a rasterizer-discard capture draw out of an open draw pass
The capture pass of a tessellation-geometry draw runs a pipeline with
rasterizer discard, which Pipeline::Begin opens without attachments. Its
render-pass key matched an ordinary draw to the same targets, so when one
was already in the open pass, StartDrawPass continued it and the capture
pipeline drew inside a rendering with attachments
(VUID-vkCmdDraw-colorAttachmentCount-06179). DrawRenderPassKey now mixes
in rasterizer discard, so the capture draw starts its own pass.

agc_driver_tessellation_geometry gains a case that records an ordinary
draw and then a tessellation-geometry draw into the same resident target
in one batch and compares the image with the ordinary draw alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 06:35:34 +00:00
Dean 14c99b52ac Merge pull request #9007 from EagleBearerYS/perf/agc-library-lto-info-when-optimized
perf(agc): retain link-time optimization info only where a link is optimized
2026-10-26 18:26:44 +13:00
Dean 1eb66943ba Merge pull request #8615 from Lindamea1/fix/agc-stencil-replay-push-data
fix(agc): put a stencil replay shader's guest buffer offsets where its shader data is
2026-10-26 18:26:40 +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