Commit Graph
3884 Commits
Author SHA1 Message Date
Adrià 87aee045df Merge pull request #6821 from JJenkx/fix/point-context-sdk-defaults
fix(agc): initialize point size and limits from SDK defaults
2026-10-19 13:45:12 +02:00
Adrià 2b6c1112b8 Merge pull request #6763 from SP4C3B4R-8/perf/windows-draw-input-copies
perf(agc): copy draw inputs on NVIDIA's Windows driver instead of binding host imports in place
2026-10-19 13:45:06 +02:00
Adrià f6eeca4f5f Merge pull request #6786 from fdfawef324/claude/agc-indirect-args-stale
fix(agc): wait for address-based writers before reading indirect dispatch arguments
2026-10-19 13:16:24 +02:00
Adrià 12e42b2730 Merge pull request #6660 from al3w0f205/fix/agcdriver-wait-reg-mem-masking-and-pipeline-drain
fix(libSceAgcDriver): mask WAIT_REG_MEM addresses and elide non-overlapping pipeline drains
2026-10-19 13:15:39 +02:00
Adrià 572130c764 Merge pull request #6767 from DavidSamir/fix/shader-interpolation-without-float64
fix(shader): interpolate 16-bit values with 64-bit integers on devices without Float64
2026-10-19 12:54:25 +02:00
Dean ff17d55ce9 Merge pull request #7745 from jotitadev/fix/agc-storage-file-write-test-hold-idle-store
test(agc): keep the queue-idle store out of the file write cases
2026-10-19 23:54:17 +13:00
Dean 72c2d5e582 Merge pull request #7774 from ionut27001/test/flip-stores-small-results-deadline
test(agc): give the flip store test the deadline its siblings use
2026-10-19 23:53:13 +13:00
Dean 1bb7656b23 Merge pull request #7676 from DavidAmsellem/test/agc-pipeline-cache-hit-detection
test(agc): measure pipeline cache hits against the bytes a pipeline adds
2026-10-19 23:52:09 +13:00
Adrià ebf054c67f Merge pull request #6781 from XairRrR/fix/cmask-clear-host-stage
fix(agc): include the host stage in the CMASK clear's host-access barriers
2026-10-19 12:45:52 +02:00
Adrià 118266aec2 Merge pull request #6760 from Ondra97/codex/fix-f64-minmax-denormals
fix(shader): honor f64 min and max input denormal mode
2026-10-19 12:27:39 +02:00
Adrià c82ffb0f20 Merge pull request #6647 from binarycleric/fix/agc-table-update-after-bind
fix(agc): bind image and sampler tables through update-after-bind limits
2026-10-19 12:20:50 +02:00
SP4C3B4R-8andClaude Opus 5.5 4a6069481f perf(agc): copy draw inputs on NVIDIA's Windows driver instead of binding host imports in place
NVIDIA's Windows driver reads a host import of guest memory far slower than a buffer it allocated.
Since draw vertex and index ranges are bound in place from host imports (#2253, measured on Linux), Astro
Bot's Crash Site on Windows 11 with an RTX 5070 Ti spends 164 ms of every frame in draws on the GPU, and
45 ms with the ranges copied as before; with the same build, 4.71 fps in place against 7.52 copied. An
RTX 3060 shows the same (draws 32.3 against 24.3 ms per frame), while AMD's Windows driver reads them in
place about as fast as a copy (RX 9070 XT: 69.8 against 73.1 ms), so copying there only costs CPU.

The device decides once (DrawInputsInPlaceUsable, Context::drawInputsInPlace): ranges are copied with
VK_DRIVER_ID_NVIDIA_PROPRIETARY on Windows and bound in place everywhere else. APS5_DRAW_INPUTS_IN_PLACE=1
binds them in place and APS5_NO_DRAW_INPUTS_IN_PLACE=1 copies them on any device, the second winning.
agc_draw_inputs_in_place_driver checks the decision per driver and host; agc_draw_inputs_copied checks
that an aligned imported range is copied and its read not noted when the context copies, whatever the
inherited environment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GN8FJFTedayRXLHythXkZ4
2026-10-19 11:48:36 +02:00
Adrià 36f60df9ed Merge pull request #6719 from fogydes/feat/agc-driver-set-flip-packet-size
feat(libSceAgcDriver): implement driver flip packet size accessor and export interface
2026-10-19 11:47:18 +02:00
Adrià d65a58e63f Merge pull request #6706 from milescoviello/perf/runtime-bda-byte-writes
perf(shader): emit runtime V# byte writes through the looping helper
2026-10-19 11:46:58 +02:00
Dean 64e2a810a9 Merge pull request #7571 from milescoviello/fix/bda-lookup-single-exit
fix(shader): leave the BDA lookup functions through one return
2026-10-19 22:26:10 +13:00
Adrià Franch d0bf34392c test(libSceAgcDriver): poll the draw pipeline to idle after both wait drains 2026-10-19 11:22:48 +02:00
Adrià Franch 1fcdf6b5d1 test(libSceAgcDriver): poll the draw pipeline to idle after a wait that elided the drain 2026-10-19 11:22:48 +02:00
al3w0f205 d59934a67c fix(libSceAgcDriver): mask WAIT_REG_MEM addresses and elide non-overlapping pipeline drains 2026-10-19 11:22:48 +02:00
Dean 83bf557dcf Merge pull request #7461 from parl0v/perf/dcc-shadow-key-sync
perf(agc): wait only for the key bytes' writers when reading DCC keys under a unit shadow
2026-10-19 22:22:12 +13:00
Dean 7f37d45ed3 Merge pull request #6451 from EagleBearerYS/fix/agc-sample-location-grid-fallback
fix(agc): fall back to pixel (0,0)'s sample locations where the device has no 2x2 grid
2026-10-19 22:22:04 +13:00
Adrià 13cf6954a3 Merge pull request #6674 from veosett/codex/fmask-image-reads
fix(agc): read uncompressed FMASK images from guest memory
2026-10-19 11:05:57 +02:00
Adrià d53d0e2d40 Merge pull request #6606 from veosett/codex/indirect-index-prefix
fix(agc): resolve sparse indirect index ranges per record
2026-10-19 10:47:44 +02:00
Adrià 52f8222af1 Merge pull request #6670 from MarcZX10/codex/lds-lock-init-race-6666
fix(shader): initialize LDS lock from one invocation
2026-10-19 10:45:39 +02:00
Adrià 5de7c09c37 Merge pull request #6669 from milescoviello/fix/msaa-cmask-codes
fix(agc): read a multisampled target's CMASK by its MSAA codes
2026-10-19 10:44:42 +02:00
Adrià f161098d3b Merge pull request #6563 from notaxeltv/feat/agc-msaa-enable-rect-list
fix(agc): allow MSAA_ENABLE single-sample rect lists
2026-10-19 10:44:32 +02:00
Adrià e12c913571 Merge pull request #6650 from WallisSkill/perf/agc-host-alloc-cache
perf(agc): cache freed small blocks per thread on Windows
2026-10-19 10:34:42 +02:00
fdfawef324andCodex 652f86e6d7 test(agc): keep direct argument case off the stopped driver
The direct-device case already drains its own work before returning. Skip the shared singleton wait after its explicit shutdown so the full suite can retain the fallback and counter assertions without throwing ProcessShutdown.

Co-Authored-By: Codex <noreply@openai.com>
2026-10-19 10:18:11 +02:00
f6c8e8474f fix(agc): wait for address-based writers before reading indirect dispatch arguments
A CPU read of DISPATCH_INDIRECT arguments waited only through the flush
hook, which waits for the ranges recorded work noted as pending writes.
An address-based store (FLAT/GLOBAL, or through a descriptor the
recompiler cannot resolve to a static buffer) is not recorded as a
pending write: its batch leases the registered allocations, and only the
guest pin waiter finished that batch. So the thread-dimension,
misaligned and disabled paths, the fill-kernel path and the device's CPU
fallback read the arguments from before an address-based producer ran.
GTA V (PPSA04264) dies loading Story on such a read: a 64-thread clear
kernel read {160, 288, 0xffffffff} as thread dimensions
(3x288x4294967295 groups), bytes its 1-thread setup kernel had not yet
overwritten with {n, 1, 1}, and threw "workgroup count
3x288x4294967295 exceeds device limits".

Every CPU read of dispatch arguments at execution now first finishes the
recorder up to the newest batch recorded with a lease
(Graphics::FinishLeaseWork). The group read-ahead still reads without
waiting; a dispatch it resolved is adopted only when the execution-time
read gives the same counts, and one that differs is dropped and counted
in the [groupcap] line. The device limit error names the argument
address and cpuReason, and the driver adds the queue, path and
read-ahead outcome. The [indirect] read time includes the lease wait,
and the [recorder] sync-site table records the offset of
FinishLeaseWork's caller. The CPU reads that still miss address-based
writes (indirect draw arguments and count, the copy kernel's count
record, the awaits-title checks) are listed in the technical debt.

IndirectArgumentsPendingProducer covers the execution-time CPU argument
reads on compute queues and the pending-label CPU fallback in the Vulkan
device. Its sixth case records a real argument label behind a host Vulkan
event in an earlier batch and an address-based producer in the later open
batch. The event releases only after that producer batch is submitted;
a bounded watchdog releases for cleanup but fails the case. It requires
a deferred producer lease, an unsubmitted producer at the argument
decision, cpuReason 2 and the fresh arguments and counter result. Small
valid stale counts keep a broken-wait control finite on every driver.
Exact CPU-reason and watchdog diagnostics identify the failing path. This
replaces a spinning workload whose earlier label could retire before
the fallback decision on lavapipe, allowing a false green with cpuReason 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex <noreply@openai.com>
2026-10-19 10:18:11 +02:00
Adrià b715404323 Merge pull request #6646 from EagleBearerYS/fix/agc-heap-mirror-replan-unwatched
fix(agc): plan a heap again when its mirror's range has left the write watch
2026-10-19 10:15:31 +02:00
Adrià 5325133b13 Merge pull request #6609 from meh7an/perf/agc-pending-writes-published-union
perf(agc): rule out pending write overlaps from the published union
2026-10-19 10:14:18 +02:00
Adrià 9a5726cc18 Merge pull request #6601 from Amoenus/codex/feat-msaa-sampled-readback
feat(agc): read individual multisample image samples
2026-10-19 10:14:12 +02:00
Adrià 5a3c515753 Merge pull request #6644 from mariuszkreft/fix/shader-ballot-once-per-block
fix(shader): ballot each predicate once per block
2026-10-19 10:14:07 +02:00
Adrià a8c934dc82 Merge pull request #6535 from gguerra26/fix/agc-unused-viewport-depth
fix(agc): normalize unused viewport depth ranges
2026-10-19 10:14:02 +02:00
David 8b7ca79869 test(agc): run the mix precision test without Float64
agc_driver_mix_precision skipped on devices without Float64 because
v_fma_mixlo_f16 and v_fma_mixhi_f16 were computed in f64. They now
compile on such devices too, so the test runs everywhere.
2026-10-19 10:10:14 +02:00
David e9af1dc0a6 test(agc): compare 16-bit interpolation with a CPU reference on random rows
The hardware rows cover rounding to nearest even only. The test now
also builds one shader per path that evaluates 2,048 random rows in all
32 modes: the eight float modes with each of the four f16 rounding
modes, which v_fma_mixlo_f16 and v_fma_mixhi_f16 use. The rows draw f16
deltas, f32 coordinates and bases from random bits, random finite
values and special values (zeros, subnormals, the largest finites,
infinities, NaNs), and a third of the bases nearly or exactly cancel the
product. Each result must match a CPU reference built on f64: the exact
product, the sum rounded to odd, one rounding at the target precision
in the mode, and the same overflow, zero and NaN rules.

On devices with Float64 the f64 path is checked against the same
reference.
2026-10-19 10:10:14 +02:00
David b8a5c1a91a test(agc): check integer interpolation against the hardware rows
agc_driver_interpolation_modes skipped on devices without Float64. It
now runs its 32 rows measured on RDNA2, for the three 16-bit
interpolation instructions in all eight float modes, through the integer
path on every device, and through the f64 path as well where the device
has Float64. The shader for one row set is built for either path, and
reports which path a mismatch came from.
2026-10-19 10:10:14 +02:00
Adrià Franch 6a894d4c1c Merge upstream/main into codex/fmask-image-reads 2026-10-19 09:48:51 +02:00
Dean 9dabcf5258 Merge pull request #7781 from MarcZX10/codex/asan-nothrow-new-7765
fix(agc): match nothrow fixture allocations
2026-10-19 20:47:35 +13:00
Adrià d8d0222d02 Merge pull request #6616 from hashaam1217/fix/agc-eop-flip-pipelined-draws
fix(agc): present EOP flips when draws are pipelined
2026-10-19 09:38:12 +02:00
Adrià 9bfbedc562 Merge pull request #6613 from milescoviello/fix/vertex-barrier-before-memory
fix(shader): emit nothing for a vertex s_barrier that precedes every memory access
2026-10-19 09:38:07 +02:00
Adrià 75ec3b5671 Merge pull request #6543 from karanvora2599/fix/agc-radv-fill-memory-hle
fix(agc): take RADV's fill-memory kernel as a buffer fill
2026-10-19 09:37:38 +02:00
Jon Daniel 070a3f12c6 fix(agc): bind image and sampler tables through update-after-bind limits
Image and sampler table capacity came only from the regular descriptor
limits. MoltenVK reports Metal's argument table limits there (256 sampled
images and 16 samplers per stage), below the typed heaps the tables are
reserved on top of, so both capacities were 0 and every table draw or
dispatch was refused as if the device lacked descriptor indexing. Its
update-after-bind limits are 1000000 sampled images and 500000 samplers.

- descriptorBindingSampledImageUpdateAfterBind is queried and enabled, and
  the update-after-bind limits are read when either it or the storage
  buffer feature is present.
- A table whose regular capacity is 0 takes its capacity from the
  update-after-bind limits. Its binding is update-after-bind and its set
  layout and pool are update-after-bind ones, in ShaderResources and in
  DescribeSetLayouts alike. A table that fits the regular limits is
  unchanged.
- An update-after-bind set layout and its allocation are checked against
  the update-after-bind sampled image and sampler limits when the device
  has descriptorBindingSampledImageUpdateAfterBind. Vulkan counts the
  descriptors of such sets against those limits in place of the regular
  ones, and requires them to be at least the regular ones only when the
  feature is supported, so without it, and for storage images, the
  regular limits are kept as before. Storage buffers keep their own
  update-after-bind flag.
- Compute pipeline capture and replay accept update-after-bind sampled
  image and sampler bindings.
2026-10-19 09:34:13 +02:00
m2 (AI Agent)andClaude Opus 5.5 d83f541c54 fix(shader): ballot each predicate once per block
Every OpGroupNonUniformBallot now goes through SpirvModule::AddSubgroupBallot.
A repeated ballot of the same predicate in the same block becomes an
OpCopyObject of the first ballot. Within one block the active invocations do
not change, so the result is identical. The cache is cleared at every label,
function boundary, function call and demote, and helper functions keep their
own cache.

When SPIRV-Tools is enabled, block merging and specialization can still put
two ballots of one predicate into the same block after emission, so
ValidateAndOptimizeSpirv collapses repeated block ballots the same way on
every module it returns, optimized or not.

NVIDIA 580's SPIR-V compiler segfaulted (libnvidia-gpucomp+0xe3facc) on GTA V
compute shaders that ballot one predicate many times in a block. One such
shader had 163 repeated ballots across three blocks. With them collapsed, both
crashing captures (compute-fe506552cec99bfc and compute-c02e5e3f35010fa5)
compile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 09:30:26 +02:00
notaxeltvandCursor 92f11a93ed fix(agc): allow MSAA_ENABLE single-sample rect lists
Filled rectangles (VGT_PRIMITIVE_TYPE 7 and 17) use the same single-sample MSAA_ENABLE path as triangles; PPSA03541 stops on a rect-list draw otherwise.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-19 09:23:53 +02:00
MarcZX10 1b6d33b43e fix(agc): match nothrow fixture allocations 2026-10-19 07:11:22 +00:00
Dean Galvin 23fc286e4c Merge main into pr-6451
# Conflicts:
#	docs/dev/debt/libSceAgcDriver.md
2026-10-19 20:08:05 +13:00
Adrià Franch e1e6ae0e79 fix(agc): add libc PATH for agc_driver_unused_viewport_depth on Windows 2026-10-19 09:02:24 +02:00
gguerra26 538b63ef4c fix(agc): normalize unused viewport depth ranges
Use representable viewport endpoints only when the draw has no depth attachment and its pixel shader does not read PositionZ. Preserve XY coverage, clip-space mode, depth clamping, and validation of non-finite inputs.

Balatro (PPSA21402) reaches rendering on Apple M1 with MoltenVK after this change instead of stopping at VK_EXT_depth_range_unrestricted. Depth-dependent draws retain their original behavior.
2026-10-19 09:02:24 +02:00
Adrià 72aba1dff5 Merge pull request #6571 from klosixgaming-arch/fix/agc-cb-resolve-msaa-disabled
fix(agc): compare a CB resolve's sample count with the rasterizer onl…
2026-10-19 08:58:54 +02:00
Adrià 64a9caa62d Merge pull request #6499 from parl0v/perf/keep-import-across-split
perf(agc): keep a host import across a split of its guest range
2026-10-19 08:54:36 +02:00