Commit Graph
1897 Commits
Author SHA1 Message Date
Dean e3d03fbae6 Merge pull request #7930 from AnthonyClemens/perf/agc-skip-empty-indirect
perf(agc): skip CPU-path indirect draws that draw nothing before buil…
2026-10-23 23:45:49 +13:00
Adrià 2f83cc782f Merge pull request #7647 from fma-rc/fix/agc-heap-mirror-resident
fix(agc): bind heap mirrors only where the guest holds bytes
2026-10-23 12:45:26 +02:00
Adrià e5ca7307cf Merge pull request #6292 from meh7an/perf/agc-draw-path-locks
perf(agc): replace winpthreads locks and TLS on the draw path
2026-10-23 11:53:59 +02:00
Adrià e5d9c923db Merge pull request #6951 from alfalfa-star/perf/agc-span-mirror
perf(agc): memoize host import run bounds per lease snapshot
2026-10-23 11:52:55 +02:00
Dean 348157914f Merge pull request #6218 from harry-z-kang/codex/issue-6119-packed-storage
fix(agc): support packed 16-bit storage images
2026-10-23 22:44:30 +13:00
Adrià a7d342efc9 Merge pull request #6948 from alfalfa-star/fix/agc-linear-readback-store
fix(agc): store linear compute writes behind their dispatch
2026-10-23 11:12:44 +02:00
Dean Galvin 8199835b02 Merge main into perf/agc-skip-empty-indirect 2026-10-23 21:43:40 +13:00
Adrià 44a59edc3a Merge pull request #6682 from EagleBearerYS/fix/agc-bda-publish-unit-shadow
fix(agc): publish unit-shadow results before an address-based build maps its heaps
2026-10-23 10:34:14 +02:00
Mehran 2659ec333e perf(agc): replace winpthreads locks and TLS on the draw path 2026-10-23 11:32:03 +03:00
Dean 98a732c0be Merge pull request #7919 from Zenodeon/astro-small-resource-fixes
fix(agc): roll back failed snapshot cache insertions
2026-10-23 21:20:17 +13:00
Adrià FranchandClaude 9f8343519f fix(agc): keep the import run memo in host thread-local storage
Co-Authored-By: Claude <[email protected]>
2026-10-23 10:04:41 +02:00
alfalfa-starandClaude Opus 5.5 5d3c0d741a perf(agc): memoize host import run bounds per lease snapshot
Every import lookup walked the lease out from the containing range to find
the run of continuing registry ranges, which is linear in the run length.
That walk depends only on the lease snapshot, the containing range and the
import window block, so its first and last index are now memoized per
thread under a weak reference to the snapshot, the range index, the window
and the window's low end. APS5_NO_RUN_MEMO walks every time.

Everything that depends on other state runs on each call as before: the
largest size, the budget, the failed blocks, the remembered refusals and
the halving block search. importRunBounds returns the chosen indices, so
sameRange, runCovers and the whole-run lookup in importAllocation compare
against the lease without copying the run's range pointers.

importRunFailureShrinkTests records a failed 8 MiB block between two
lookups on an unchanged registry and requires the run to shrink to its
4 MiB blocks. importRunGrowthTests and importRunReplacedTests check that a
run grows and shrinks when its ranges are registered or replaced.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 10:04:37 +02:00
Dean 21554447d0 Merge pull request #6848 from NFSS10/nfss10/performance_improvements
perf(agc): clear single-key DCC surfaces on a verified uniform color
2026-10-23 20:45:46 +13:00
Yunus Shaikh 530c6fb0df fix(agc): publish the units a completion store covers partly before it lands
A CPU store made inside a completion action (a copied buffer's write-back)
reached the flush hook with PublishScope::None, and PublishShadow skipped
such stores anyway. Nothing was published before the store landed, and
its own stamp then made every unit it touched stale, so the next publish
dropped those units whole: the storage results the store did not cover
were lost, both those already in the unit shadow and those of a pending
image the hook had just stored into it.

The hook now publishes the units such a store covers partly, as outside
completion actions, and its full Sync inside completion actions lands
the copies before the store. PublishShadow, FlushPending and
PublishShadowsOnly take a waited flag for this; other publishes made by
completion stores are still skipped.
2026-10-23 09:33:29 +02:00
Yunus Shaikh fe0383c0d6 fix(agc): publish unit-shadow results before an address-based build maps its heaps
An address-based build binds the registered heaps in place and does not
store the storage results pending in them. With unit shadows on, a
write-back that retiled into the shadow reaches the import only through a
publish, and nothing published before such a build, so its pointer reads
saw the bytes of the last publish.

UploadFinish now publishes the fresh units over the heaps the build maps:
the address space's base on the cached path, the exempt in-place regions
on the per-build path. One AnyShadowedOverlaps check over their span
gates it, pending results stay pending, and the copies count under their
own publish reason, "address".
2026-10-23 09:33:15 +02:00
Dean 664648356c Merge pull request #8751 from janzezno/fix/hook-sync-recorded-store
fix(agc): sync a host read on a store recorded after its snapshot check
2026-10-23 20:24:42 +13:00
Dean 16319642a4 Merge pull request #6946 from Raghav314/perf/agc-draw-pipeline
perf(agc): draw finisher pipeline (APS5_DRAW_PIPELINE)
2026-10-23 18:24:48 +13:00
Dean a701f9f788 Merge pull request #6801 from JJenkx/feat/geometry-points-sized
feat(agc): rasterize geometry points with their point size
2026-10-23 14:38:10 +13:00
Dean Galvin 6990044dfb Merge main into feat/geometry-points-sized 2026-10-23 12:43:00 +13:00
Dean 56cf43844e Merge pull request #8962 from Celegans12/fix/agc-r128-texture-max-mip
fix(agc): read 128-bit T#s that start past MAX_MIP from their resident levels
2026-10-23 12:10:17 +13:00
Yunus Shaikh 1aacde9a68 fix(agc): keep the draw pipeline's thread-local scratch in HostThreadLocal
On Windows a thread_local destructor in a module runs after emulated TLS
has freed the object, and prx_thread_local_destructors refuses
libSceAgcDriver.prx for it. The draw pipeline of upstream PR 6946
(Raghav314, f8192a64b3) added such scratch objects:
DrawFinisher::Enqueue's and DrawPipeline::Enqueue's reclaim lists,
CachedFragmentOutputs' last key and outputs, DecodeVertexStageInfo's
attribute and buffer tables, and PrepareDrawBindings' pool size counts.
They now live in HostThreadLocal, as the driver's other per-thread
scratch does; on other hosts that is the same thread_local.
2026-10-23 03:46:57 +05:30
raghav314andClaude Opus 5.5 c0dbd1871c perf(agc): draw finisher pipeline (APS5_DRAW_PIPELINE)
The second half of a pipelined draw (stage materialization, cache insert,
enqueue) runs on a finisher thread, overlapping the next draw's packet
work; draws whose stages could write memory are held back. Commits skip
work whose inputs did not change since the last commit, color metadata
passes are ordered through the pipeline, resource and storage-image proofs
are reused within one collect epoch until a write breaks them, and a shape
entry is refreshed in place at the second sight of the same read user words.
APS5_VERIFY_DRAW_PIPELINE checks reused proofs against a full check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 03:46:57 +05:30
milescovielloandClaude Opus 5.5 36559da793 feat(agc): draw one-sample color targets beside a multisampled depth target with sample 0's coverage
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 19:58:10 +00:00
milescovielloandClaude Opus 5.5 2fbab7aff4 fix(agc): chain a linked pipeline's attachment sample counts to its create info
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 19:57:33 +00:00
milescovielloandClaude Opus 5.5 7c63ee6970 fix(agc): give a pipeline linked from libraries its attachment sample counts
An overrasterized draw (a multisampled rasterizer into one-sample color
targets, VK_NV_framebuffer_mixed_samples) chains
VkAttachmentSampleCountInfoNV into its pipeline. When the pipeline is
linked from graphics pipeline libraries, only the fragment output library
carried it, and the link and the background link-time-optimized relink
did not. The Khronos validation layer (1.4.363) then reports
VUID-vkCmdDraw-multisampledRenderToSingleSampled-07285 for every such
draw, as it does in agc_driver_pixel_sample_coverage, and not with
APS5_NO_GPL=1, where the pipeline is built whole.

Both links now chain a copy of the sample counts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 19:57:33 +00:00
Dean a62feecd6c Merge pull request #7948 from Amoenus/codex/feat-native-owner-fmask
feat(agc): expose expanded FMASK for tracked native owners
2026-10-23 08:54:11 +13:00
Kang, Harry Zixuan 812928af24 fix(agc): support packed 16-bit storage images 2026-10-22 12:39:54 -07:00
Dean d6e7ab42df Merge pull request #6727 from simonbronk/fix/native-msaa-depth-unwritten-guest-access
fix(agc): retire an unwritten native multisample depth surface on guest access
2026-10-23 07:55:56 +13:00
xXPBSXxandClaude Sonnet 5.5 7e2cc7ec6b fix(agc): accept the standard component order for 11_11_10 float color targets
PPSA12361 binds color format 7 (COLOR_11_11_10, float) with COMP_SWAP 0
and stops on "unsupported color format 7 number type 7 component swap 0".
Only the reversed order (COMP_SWAP 2) was accepted.

The format keeps its 10-bit component in the low bits. The standard
swap puts red in the first slot, as Mesa pairs SWAP_STD with
COLOR_10_11_11 for R11G11B10_FLOAT, so COMP_SWAP 0 puts red there and
COMP_SWAP 2 blue. Swap 0 now decodes with the identity export mapping
0xe4 and the same packing; the other swaps still throw.

The decode test accepts swap 0 and keeps refusing swaps 1 and 3. The
execution test renders both orders into tiled and linear targets and
compares each stored word with the packing of the order. Its program
pool grows to fit the second pass. The debt entry names the accepted
orders and says the swap 0 layout is derived, not measured.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-22 19:46:23 +02:00
Adrià 0def01bcb5 Merge pull request #8538 from LeandroLP23/fix/recompiler-flat-p20-provoking
fix(recompiler): read P20 of a flat input as the provoking vertex
2026-10-22 19:26:58 +02:00
Dean e5c5329251 Merge pull request #8099 from LuisAguilarDev/fix/agc-stencil-clear-absent-plane
fix(agc): ignore a stencil clear on a target without a stencil plane
2026-10-23 05:43:36 +13:00
LeandroLP23andClaude Opus 5.5 1bf43f9b02 fix(recompiler): read P20 of a flat input as the provoking vertex
A FLAT_SHADE input without pass-through that a pixel shader reads
through v_interp_mov_f32 P20 and not P10 stayed an explicit per-vertex
input and read vertex 2 minus vertex 0. For a flat value that is the same
on every vertex the difference is 0, and with the first provoking vertex
nothing refused it.

ps5-opengl lowers every flat input to a load of one vertex: vertex 1
(P10) by default, which #4030 reads as the provoking vertex, and vertex 2
(P20) for triangles when GL's flatshade_first is set. SuperTuxKart's
deferred point lights are drawn that way, so all twelve flat inputs of
pointlight.frag read 0, the attenuation 0 * -inf was NaN, nothing was
discarded, and the starting-line referee's light quad blacked out the
scene behind it (#8364).

A P20-only read now returns the provoking vertex's value, as P10 and P0
do. The lane was not measured on the console either, so FragmentParameter
records it and a pipeline using the last provoking vertex throws. An input
read through both P10 and P20 keeps its per-vertex differences.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 18:37:47 +02:00
Dean 751b2881ae Merge pull request #8871 from thuanquang/fix/msaa-enable-clear-lines
fix(agc): draw line lists and strips into a multisampled target with MSAA_ENABLE clear
2026-10-23 05:20:48 +13:00
Romans Pokrovskis b8c6a94572 chore(agc): refresh PR 7948 on current main 2026-10-22 19:13:40 +03:00
Dean b7d1d47a5f Merge pull request #8083 from DavidSamir/feat/agc-barycentric-tessellation-strips
feat(agc): draw triangle strips through the barycentric tessellation stages
2026-10-23 03:22:55 +13:00
Dean 329efe1bfd Merge pull request #7371 from Amoenus/codex/fix-native-htile-clear-handoff
fix(agc): settle queued HTILE clears before native depth use
2026-10-23 03:14:33 +13:00
Dean 8b3e39832a Merge pull request #8847 from JJenkx/fix/agc-msaa-srgb-twin
fix(agc): resolve and render a multisampled target through its sRGB twin format
2026-10-23 02:28:25 +13:00
Romans Pokrovskis d62377dd75 fix(agc): settle queued HTILE clears before native depth use 2026-10-22 16:03:20 +03:00
Dean 3ca07d086d Merge pull request #7233 from MarcZX10/codex/bda-store-exact-coverage-7220
fix(agc): separate possible writes from complete coverage
2026-10-23 01:53:33 +13:00
Dean cc0078595d Merge pull request #8992 from SP4C3B4R-8/refactor/draw-prepare-record
refactor(agc): split Graphics::Draw into a prepare and a record step
2026-10-22 22:47:27 +13:00
SP4C3B4R-8 930b9640d7 refactor(agc): split Graphics::Draw into a prepare and a record step 2026-10-22 11:18:29 +02: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
simonbronkandClaude Opus 5.5 bf0806ecd6 fix(agc): retire an unwritten native multisample depth surface on guest access
A guest read over the depth or HTILE range of a native multisample depth
surface threw even when the host had not written the surface since its
import. Its samples are then still the clear value the import took from
the guest HTILE, so the guest bytes already describe it. Retire such a
surface and its guards instead, and keep the refusal for a surface the
host wrote: draws with depth or stencil writes, depth/stencil copies and
storage write-back.

Onimusha: Way of the Sword (PPSA27836) imports a 4-sample D32 target,
draws into it once with depth tests only and no color target, then reads
the memory back as a structured buffer in a compute dispatch.

Unblocks PPSA27836.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 10:02:25 +02: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
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 Galvin a0cb9e4b6c Merge main into nfss10/performance_improvements 2026-10-22 16:59:12 +13:00
thuanquangandClaude 0efe28a839 fix(agc): draw line lists and strips into a multisampled target with MSAA_ENABLE clear
A line list or strip drawn with PA_SC_AA_CONFIG above 1x and
PA_SC_MODE_CNTL_0.MSAA_ENABLE clear threw, and METAL GEAR SOLID: Peace
Walker (PPSA18216) draws such lines into its 4x target. They now take
the path triangles already take in this state: the target's sample
count with every sample at the pixel center, or one sample under a
one-sample color target.

The refusal now reads the primitive the draw rasterizes
(RasterPrimitiveOf) instead of VGT_PRIMITIVE_TYPE: a point list that a
geometry program turns into triangles or lines is drawn as those, and
rasterized points and alpha-to-coverage still throw. No draw on main
rasterizes points in this state, because a vertex-path point list and
a geometry program's point output throw earlier; the point term takes
effect once they are drawable, as with #6801.

The new GPU test decodes a line list and a line strip into a 4x target
in this state with DecodeState, draws the decoded state, and requires
every pixel to be covered in all four samples or in none.

Co-Authored-By: Claude <[email protected]>
2026-10-22 10:48:35 +07: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
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