Commit Graph
4691 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
Dean Galvin 16686375a9 fix(agc): keep the empty-indirect classification cache in HostThreadLocal
On Windows a thread_local destructor in a module runs after emulated TLS freed
the object (prx_thread_local_destructors). Keep the per-thread map in
HostThreadLocal like the other per-thread objects in libSceAgcDriver.
2026-10-23 22:57:56 +13: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 54a5b24b5f fix(agc): share the empty-indirect skip state between draw and finishDraw
The draw was split into draw and finishDraw, so the skip flag and the per-program
classification cache declared in draw were out of scope where finishDraw records
the classification. Indirect draws never hand off to the finisher, so both
functions run on the same thread; make the cache and the switch file-scope
accessors that both use.
2026-10-23 21:44:50 +13: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 72fe76ff89 Merge pull request #7920 from hugodearaujo/feat/agc-amd-buffer-marker-checkpoints
feat(agc): record GPU checkpoints through VK_AMD_buffer_marker
2026-10-23 21:20:57 +13: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
Dean 30ecc1b7b3 Merge pull request #8643 from realshinmalphur/fix/gpu-command-validation
fix(agc): validate the exact indirect draw record range
2026-10-23 21:15:35 +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 546040adc5 test(agc): size the address shadow test's heap past the Windows settle floor
On Windows only host imports of 1 MiB or more are settled and stay
write-watched; a smaller import is compared, so its range leaves the
watch and the unit shadow never engages. The address shadow test's heap
was 256 KiB, so both of its tests skipped on Windows with "the heap is
not imported or not watched", with the fix and without it.

The heap is now 2 MiB, filled exactly by a 1024x512 storage image, and
its allocation keeps one unregistered 64 KiB block after the range, so
no other registered range can continue it into a larger import run.
The assertions and Linux's forced watch are unchanged.
2026-10-23 09:33:16 +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
Adrià 0db47b263d Merge pull request #7831 from MarcZX10/codex/fix-perspective-offset-barycentrics-7825
fix(shader): normalize offset perspective barycentrics after interpolation
2026-10-23 07:37:02 +02: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
MarcZX10 f6826208fb fix(shader): normalize offset perspective barycentrics 2026-10-23 06:32:27 +02: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 316b742490 Merge pull request #9070 from xdCloudy/fix/agc-storage-edge-writeback
feat(libSceAgcDriver): build NOP data-write packets
2026-10-23 14:16:25 +13:00
xdCloudy c0e6c9b14f test(agc): add driver DLL path for packet test 2026-10-23 01:38:41 +01:00
Dean Galvin 6990044dfb Merge main into feat/geometry-points-sized 2026-10-23 12:43:00 +13:00
Dean 775b50729c Merge pull request #9086 from xdCloudy/feat/agcdriver-evidenced-impls
feat(libSceAgcDriver): implement diagnostic fallbacks
2026-10-23 12:11:16 +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
Dean bd1d3994ce Merge pull request #8296 from hypermoist/fix/agc-capture-instrumentation-query-sizes
fix(agc): return the console results of the capture, shader instrumentation and occlusion query size calls
2026-10-23 11:42:34 +13:00
Dean 48f578b909 Merge pull request #8382 from orezraey/fix/screenshot-dir-wide-env
fix(agc): read ANYPS5_SCREENSHOTS through the wide environment on Windows
2026-10-23 11:41:36 +13:00
Dean 5b6f1a6809 Merge pull request #8361 from Amoenus/codex/test-array-window-view-bounds
test(agc): match array sample expectations to the view
2026-10-23 11:28:22 +13:00
Yunus Shaikh a9e2141431 test(agc): run the draw cache relocation test on the draw pipeline 2026-10-23 03:46:57 +05:30
Yunus Shaikh 5595ad7c7b test(agc): count the draw finisher trace test as skipped when the build leaves it out 2026-10-23 03:46:57 +05:30
raghav314andClaude Opus 5.5 635c1ff656 fix(agc): release finished draw pipeline items at shutdown so the device is destroyed
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 03:46:57 +05:30
raghav314andClaude Opus 5.5 89ebfe1f94 perf(agc): queue labels behind finisher draws instead of draining the finisher
A WRITE_DATA or RELEASE_MEM label the worker queues for the committer
drained the draw finisher first, so that it could not reach the committer
before the draws the finisher still held. In Hades II nearly every drain
of the finisher was one (81,762 of 82,467 per 10 s were WRITE_DATA).
While the finisher holds draws, the label's enqueue now runs as a
finisher job, so it reaches the committer after them, and its write
range and value are a pending write of the finisher until then. A
WAIT_REG_MEM that a pending label satisfies, in the finisher or behind
it, stays beside the finisher as it did beside the committer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 03:46:57 +05:30
Scramblrrrr 9898600145 fix(agc): include draw finisher work in CPU traces 2026-10-23 03:46:57 +05:30
raghav314andClaude Opus 5.5 a220da9f57 fix(agc): drain the draw finisher before the committer stops at exit
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 03:46:57 +05:30
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
Dean 944ff6c97e Merge pull request #9249 from Pacuka/fix/shader-3d-store-2d-array-tsharp
fix(shader): accept 3D image stores on 2D-array T#s
2026-10-23 11:06:04 +13:00
Dean d3efe3af99 Merge pull request #8115 from milescoviello/feat/msaa-depth-one-sample-color
feat(agc): draw one-sample color targets beside a multisampled depth target with sample 0's coverage
2026-10-23 10:38:32 +13:00
Joey Fisher 1499ae961d test(agc): collect the idle publish test block before the label retile
agc_idle_publish_wait fails on RADV (RX 570, Steam Deck, #9781) at the label
flush check: the publish was not waited, it was dropped as stale. The idle
flush's submission is the first to reference the test block's host import,
and amdgpu validates a user pointer's pages with write faults at every
submission, which clears the asynchronous userfaultfd write protection of the
whole import. The test forces APS5_WRITE_WATCH_IMPORTS=watch (the probe in
decideImportWatch would leave such imports compared), so the next collect
reads every unit as stored by the CPU. The test retiled unit 5 without
collecting first, so the label publish's own collect stamped the unit newer
than the retile's generation and publishUnits dropped it; no copy was
recorded and PendingWriteOverlaps was false.

The test now collects before that retile, as it already did before the idle
ones, and models the condition on every driver with an uncollected store
older than the retile. The checks run in an order that names the dropped
publish before the wait.
2026-10-22 14:42:00 -06:00
Adrià 7c900bbc21 Merge pull request #6645 from DangerChamp/codex/fix-completed-pixel-lane-proofs
fix(shader): reuse completed pixel lane proofs
2026-10-22 22:34:50 +02:00
Dean 9366a29432 Merge pull request #9697 from EagleBearerYS/fix/agc-pipelined-fill-blocker-lifetime
test(agc): share the pipelined fill blocker with its lambda and end each case on an empty pipeline
2026-10-23 09:22:17 +13:00
milescovielloandClaude Opus 5.5 4ba0175ba2 test(agc): skip the truncated coverage case without two-sample depth targets
ExpectTruncated draws with a two-sample D32 depth target. On a device
whose framebufferDepthSampleCounts lacks 2, as lavapipe, the pipeline's
existing sample count check refused that depth target before the
truncated coverage check, and the test failed. The case now reports why
it was not tested: no two-sample depth targets, or neither mixed sample
extension with truncated coverage reduction.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 19:58:11 +00:00
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