Commit Graph
2834 Commits
Author SHA1 Message Date
AlxcBTW 139e3b86ed fix(agc): route native-owned depth binds before the HTILE read and store-back
A multisampled depth target is created as, or already is, the native depth owner, and a target whose HTILE overlaps a resident depth guard aliases one. Neither may have its HTILE read or rewritten by the generic store-back: the expanded words would be a guest write over the owner's range. DepthSurfaceView decides this before the store-back, which still runs before GpuMutex() and the surfaces mutex are taken. NativeMultisampleDepth binds the owner and a single-sample alias of its HTILE and checks the words stay untouched.
2026-10-15 13:55:39 +02:00
Adrià 23dcb82499 Merge pull request #5648 from Amoenus/codex/buffer-resource-vcc-tuple
fix(shader): accept buffer resource tuples ending in VCC
2026-10-15 13:55:14 +02:00
Adrià Franch 0a7193b5cd fix(libkernel): sigsuspend swaps and restores all four mask words 2026-10-15 13:54:05 +02:00
AlxcBTW cc022df348 fix(agc): take a slice of a depth array from its own HTILE only when its words are uniform
A fill or clear the driver recognizes over an HTILE drops the range's last-read generation, so the
next bind reads the words and stores them back even when the write tracker did not see the fill's
stores. A depth view of slice 1 or later reads the HTILE at its own address
(DB_HTILE_DATA_BASE + slice * HtileMetadataBytes); the HTILE word layout is only modelled for slice 0,
so such a slice takes the clear and the store-back only when all its words are equal and keeps its
fill-time fast clears otherwise. DepthTarget::slice carries DB_DEPTH_VIEW SLICE_START.

agc_driver_depth_fast_clear_submit: an unrecognized kernel clears the HTILE on two frames in a row and
both clears are taken; slice 1 with words that are not all equal is refused and stored back untouched;
slice 1 with equal words takes the clear. agc_driver_graphics checks the decoded slice.
2026-10-15 13:53:50 +02:00
AlxcBTW 3e61fcf1f9 fix(agc): read and store back the whole pipe-aligned HTILE outside the surfaces lock
The bind-time HTILE read covered one word per 8x8 tile from DB_HTILE_DATA_BASE, but main models the
HTILE as the pipe-aligned SW_64KB_Z_X metadata (HtileMetadataBytes, the extent HtileFillCovers takes):
at 1920x1080, 1856 of the 32400 tile words lie past the first tiles*4 bytes, so they kept ZMask 0
after a store-back. The read and the store-back now cover the whole metadata and run before the
surfaces mutex is taken, since both wait for recorded work over the range. The tests' HTILE arrays
hold the whole metadata.

PPSA25344 (Unreal Engine 5) decodes its depth through HTILE in its Nanite depth export after the
depth prepass and takes ZMask 0 as a tile holding the clear value; the new
agc_driver_depth_fast_clear_submit case checks that a draw after a fast clear leaves every word
expanded.
2026-10-15 13:53:50 +02:00
esatturan 4ddff7c6e5 fix(agc): take depth fast clears from HTILE written by any kernel 2026-10-15 13:53:49 +02:00
Adrià fdea36b836 Merge pull request #5524 from Amoenus/codex/native-depth-allocation-retirement
fix(agc): retire fully released native depth owners
2026-10-15 13:50:13 +02:00
Adrià FranchandClaude a8be2c8fee docs(ngs2): matrix levels debt line names the voice-without-format exception
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-15 13:49:09 +02:00
milescovielloandClaude Opus 5.5 c6e3af3258 fix(ngs2): accept empty waveform blocks and matrix levels on a voice without a format
A sampler voice set up with an all-zero format has no channels. Adding no
waveform blocks to it, or setting a matrix with no levels, threw
std::invalid_argument, which ends the title.

Accept both on such a voice: the empty add only applies RESET and the
CONTINUE state, and the empty matrix clears that matrix, which rendering
already treats as unset. Blocks with data, APPEND, and an empty matrix on
a voice with a format are still refused.

Steins;Gate Re:Boot (PPSA36591) clears a voice this way when a button is
pressed at its title screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 13:48:54 +02:00
fdfawef324andCodex 6541db004b fix(agc): disable optional BMP dumps after host I/O failures
Use checked host stdio for BMP output and stop requesting dumps after the first write failure. Keep pixel validation, allocation and non-I/O failures on the existing fatal path.

Co-Authored-By: Codex <noreply@openai.com>
2026-10-15 07:39:36 -04:00
Adrià 38d2454486 Merge pull request #5559 from JJenkx/fix/guest-executable-import-dependencies
fix(relinker): select guest startup dependencies from required roots
2026-10-15 13:38:52 +02:00
Adrià 5050a23f38 Merge pull request #5473 from MarcZX100/type0-recompiler-followup-4779
fix(shader): accept TYPE=0 images during materialization
2026-10-15 13:37:52 +02:00
KernelPanicNTandClaude Opus 5.5 5b7e3aea8b feat(libSceAmpr): implement __cxa_call_unexpected
__cxa_call_unexpected takes the in-flight exception's unwind header and
never returns, as in libcxxabi. No std::set_unexpected is exported and
the exception header's unexpected handler is never set, so the handler
is always the default one, which calls std::terminate. It therefore
forwards to libc's __cxa_call_terminate, which begins the catch and runs
the current terminate handler; a null header terminates in libc's
__cxa_begin_catch. libcxxabi's std::terminate would instead run the
terminate handler saved in the exception header at throw time; the two
differ only if std::set_terminate was called in between, which the debt
entry records.

The test shares the forked-child helper of the std::_Pad test, which now
takes the terminate handler to install.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 11:31:15 +00:00
Adrià 5e7d09aafe Merge pull request #5538 from JJenkx/fix/ngs2-render-capacity
fix(ngs2): limit render writes to the configured grain
2026-10-15 13:29:33 +02:00
Adrià 821c69e504 Merge pull request #5509 from billythemenace2/fix/shader-cube-tsharp-2d-access
fix(shader): read cube T#s through DIM 2D image_sample and image_load as face 0
2026-10-15 13:25:34 +02:00
Adrià 39d3ae13eb Merge pull request #5304 from tv7/fix/stencil-ref-export-unused
fix(agc): drop an unused stencil test value export from draws without a stencil test
2026-10-15 13:24:56 +02:00
hypermistandClaude Opus 5.5 7d7515b632 docs(debt): drop the call tracing entry that --trace-imports superseded
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 00:14:25 +13:00
Adrià FranchandClaude 91878f51f9 docs(debt): describe the TYPE=0 null image scope as implemented
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-15 13:12:00 +02:00
Adrià Franch 6f0aa97f6c docs(debt): describe the unused stencil export drop next to the stencil replay 2026-10-15 12:51:37 +02:00
NikoandClaude Opus 5.5 c434467f6c fix(agc): form reversed-order blend factors from copies of the export
The reversed-order blend computed the factors Vulkan cannot apply per
channel in the pixel shader (1 - x in fp32, a clamp for UNORM targets
and, when both positions needed it, a premultiplied export) and passed
them to the blend as a dual-source second color. A plain blend converts
the export once and forms 1 - x and the products from that converted
value, so the two paths can round differently. On UNORM8 the difference
reaches one step per substituted factor: an Intel iGPU stored 161 where
the exact blend is 159.75 for SRC_COLOR + ONE_MINUS_SRC_COLOR with an
export of 0.5 over 192 (160 through SWAP_STD), and on an RTX 5080 and
lavapipe the split path differed from the same draw into a SWAP_STD
target by up to 2 steps on other inputs.

The pixel shader now only copies values. Each channel of the second
color is the exported alpha, the channel's own export or the constant 0
or 1, and a channel of the first color whose source factor is ONE may
become 1 with its export moved into the factor. Every factor, 1 - x and
product comes from the blend through SRC1_COLOR, SRC1_ALPHA and their
ONE_MINUS forms, applied to copies of the same export values that the
first color carries. TranslateReversedBlend searches for Vulkan factors
and copy routes that reproduce each channel's guest factors and throws
for combinations no routing reproduces, such as ONE_MINUS_SRC_ALPHA in
the alpha equation next to SRC_COLOR in the color equation: of the 1995
factor combinations the shader used to compute, 932 are routed and the
others throw again, as on main. GT7's 0x65010504 is among the routed
ones. The code is now four 2-bit routes for each color, the same for
every format, and the post-pass emits no arithmetic.

agc_driver_reversed_order_blend also draws each case into a SWAP_STD
target, which Vulkan blends alone, and requires identical stored bits;
the comparison with the exact blend keeps its 1-step tolerance.
agc_driver_graphics checks every factor combination TranslateReversedBlend
accepts against the guest equations and that the post-pass adds no
arithmetic instructions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 12:51:27 +02:00
NikoandClaude Opus 5.5 16ea32c97d feat(agc): blend into color targets with a reversed component order
8_8_8_8 and 16_16_16_16 targets with COMP_SWAP 2 or 3 keep the exported
alpha in their first channel and red or blue in their fourth, so a plain
Vulkan blend would run the alpha equation on a color channel. Such draws
threw "blending into a color target with a reversed component order is
not implemented" (Gran Turismo 7, #4782).

The AMD SI and CIK register references describe CB_TARGET_MASK in the
order of components after blending and before COMP_SWAP is applied, and
RADV programs CB_BLENDn_CONTROL without regard to the swap while it
renders R4G4B4A4, B4G4R4A4, R5G5B5A1 and B5G5R5A1 through SWAP_STD_REV
and SWAP_ALT_REV and passes the CTS blend tests on Navi10. The color
block is therefore taken to blend in export order: the alpha equation
and source-alpha factors use the exported alpha and the destination
alpha is the first channel.

TranslateReversedBlend keeps the factor pairs Vulkan applies per channel
in the pipeline. Other source factors are computed by the pixel shader
from its MRT0 export (clamped for UNORM targets, as BLEND_CLAMP says)
and handed to the blend as a dual-source second color, which the
fragment output post-pass adds at location 0 index 1; when both
positions need it, the export is premultiplied by its source factor.
The code is a pipeline specialization, serialized in request version
26, and stays out of the prepared shader key.

sRGB, SNORM and integer targets, constant and second-source factors,
destination alpha in the color equation, destination factors the two
equations do not share, different color and alpha operations, MIN or
MAX with factors other than ONE, other color exports when the shader
computes factors, and devices without dualSrcBlend still throw, now
with the blend control, mapping and format in the message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 12:51:27 +02:00
Adrià FranchandClaude 03401459f9 perf(agc): pipelined draws and exact draw write ranges on by default
Queue 0 now pipelines draw commits unless APS5_PIPELINED_DRAWS=0, and draw write ranges use the exact
color, DCC, CMASK, depth and stencil sizes unless APS5_EXACT_DRAW_WRITES=0. The base tests now run the
pipeline; agc_driver_pm4_failure_inline and agc_driver_draw_cache_reuse_inline keep the inline path
covered.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-15 12:13:26 +02:00
Romans Pokrovskis da9fe3c708 fix(agc): retire fully released native depth owners
Track successful releases cumulatively across the complete depth and HTILE ownership ranges. Preserve color retirement and share its single callback; keep retired image contents alive through sampled views and recorded work. Add registry, partial/failure/protection, remap and mixed teardown regressions. Depends on native depth sampling in PR5496 and its descriptor prerequisite PR4820.
2026-10-15 13:08:13 +03:00
Adrià FranchandClaude 4051ee19c5 docs(architecture): describe the queue-0 draw pipeline
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-15 11:34:29 +02:00
Yunus Shaikh 896b737700 fix(libSceNet): keep one receive timeout across the wait for a local address
When the address came during the wait, the host receive that followed
waited its whole SO_RCVTIMEO again, so a receive could take up to twice
the timeout. FreeBSD's soreceive_dgram sleeps once per timeout. Now the
receive waits for a datagram with WSAPoll only for what is left of the
timeout, and fails with EAGAIN when it runs out, as before. Nothing
changes when the socket already had an address or has no timeout.
2026-10-15 02:34:12 -07:00
SP4C3B4R-8andClaude Opus 5.5 626cff7d26 fix(libSceAgcDriver): retire a depth surface once another writer covers its memory
A depth surface lives only in its Vulkan image, so a view of its memory
with another layout could only throw, and a matching view kept reading
the image after other writes over its memory. Retire the surface when a
color target or a written storage image it does not serve overlaps its
planes, or when a view it cannot serve finds guest memory over the planes
written since the surface was last bound; lookups then skip it and the
view reads the memory like any texture. Binding the target again brings
the surface back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 11:00:36 +02:00
Adrià 0afa6a607e Merge pull request #6060 from parl0v/feat/watched-private-imports
perf(agc): keep Windows host imports of write-watched private memory watched
2026-10-15 10:54:43 +02:00
Adrià c4f03522a7 Merge pull request #5496 from Amoenus/codex/native-msaa-depth
feat(agc): sample native multisampled depth attachments
2026-10-15 10:54:18 +02:00
Yunus Shaikh a9c2717fd0 fix(libSceNet): return 0 from an unbound datagram receive after shutdown or for zero bytes
On Windows a receive on a datagram socket with no local address waits
for one. A sceNetShutdown of the receive side now ends that wait, and
later receives return 0 at once; a zero-length receive returns 0 without
waiting. FreeBSD's soreceive_dgram returns 0 in both cases. Before, a
thread blocked in such a receive kept waiting after the socket was shut
down.
2026-10-15 01:54:10 -07:00
Adrià db81992c55 Merge pull request #5238 from MarcZX100/fix/trace-draw-program-addresses-5166
feat(agc): trace shader addresses for each draw
2026-10-15 10:06:31 +02:00
Adrià FranchandClaude 290be56265 test(agc): skip the dma-buf import probe when /dev/udmabuf can't be opened
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-15 10:05:09 +02:00
Adrià FranchandClaude 23fccd7632 fix(agc): settle only imports of 1 MiB or more
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-15 09:58:21 +02:00
Josip Parlov 295b1c55f4 fix(agc): drop the import-watch environment switches
The second queue that settles imports is always created on Windows, and a device without one keeps
the comparisons. The other-family settle path is tested through the recorder test device built
with its settle queue on another family (agc_import_watch_other_family) instead of
APS5_SETTLE_OTHER_FAMILY.
2026-10-15 09:46:48 +02:00
Josip Parlov 42178b494d test(agc): a store from another thread within an import window
The settle read keeps a private import's window open for one round trip on the settle queue, so a
store from another thread can land inside it. CheckImportWindowOtherThread: a store of new bytes from
another thread within the window counts as written, and a same-value one keeps its possible CPU
touch. The debt entry notes the longer window.
2026-10-15 09:46:48 +02:00
Adrià FranchandClaude 1ff6ca7a67 docs(architecture): describe settled watched imports of private memory on Windows
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-15 09:46:48 +02:00
Josip Parlov 9ba58c2a60 perf(agc): keep Windows host imports of write-watched private memory watched
On Windows a host import without a section alias left guest write tracking, and its changes were
found by comparison. Since resident direct memory became private MEM_WRITE_WATCH memory, its
imports take that path, and every storage-texture refresh over it compares its whole snapshot.

ProbeImportWriteProtection gets a Windows body on MEM_WRITE_WATCH scratch memory, and
decideImportWatch keeps direct imports of private read-write memory watched when GetWriteWatch
stays honest after an import's first GPU use. The driver marks every imported page written until
that use completes, so each such import is settled inside ImportWatched's window by a 4-byte read on
a second queue of the graphics family (the imports lock comes after GpuMutex, so the main queue
cannot be used there). APS5_NO_WATCHED_PRIVATE_IMPORTS=1 keeps the comparisons.
2026-10-15 09:46:48 +02:00
fogydes e088fd8741 fix(libScePlayGo): let users answer unlisted chunks 2026-10-15 11:48:51 +05:30
akkadbakkad89andDevin a7da412a71 fix(libkernel): follow kqueue_register for EV_FORCEONESHOT and modify flags
On a new knote EV_FORCEONESHOT is dropped from the flags; on an
existing one it sets EV_ONESHOT and fires the knote, as
kqueue_register does at l.1339-1341. A modify no longer ORs
EV_ONESHOT, EV_CLEAR or EV_DISPATCH into the knote.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-15 06:01:06 +00:00
akkadbakkad89andDevin b32c5a50cd feat(libkernel): implement kevent EV_DISABLE, EV_DISPATCH and EV_FORCEONESHOT
A knote registered or modified with EV_DISABLE stays registered but is
not polled, fired or reported until an EV_ENABLE change re-arms it, as
kern_event.c does with KN_DISABLED. EV_DISPATCH reports an event once
and then disables the knote, and EV_FORCEONESHOT registers as oneshot.
A negative nevents fails with EINVAL instead of throwing.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-15 06:00:43 +00:00
alfalfa-starandClaude Opus 5.5 56d8b4f68d feat(npmanager): implement sceNpGetUserIdByAccountId
Account id 0 or a null output returns SCE_NP_ERROR_INVALID_ARGUMENT;
otherwise the always signed-out NP returns SCE_NP_ERROR_SIGNED_OUT, as
sceNpGetAccountIdA does. PPSA14632 imports it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 08:00:31 +02:00
JJenkx d94000a096 fix(relinker): load guest providers used by executable imports 2026-10-15 01:40:33 -04:00
Rujul Talekar 3dffc8ca9e fix(libc): give collate<wchar_t> its own 16-bit vtable 2026-10-15 11:07:58 +05:30
Celegans12 625525de79 fix(libSceNetCtl): answer the DHCP host name, PPPoE name and proxy server as empty strings
Since #5056, sceNetCtlGetInfo throws for every info code it does not
model. Ghost of Yotei (PPSA26344) asks for code 12, the DHCP host name,
during boot and now aborts one second in.

The configuration #5056 reports (wired, DHCP, HTTP proxy off) sets no
DHCP host name, no PPPoE user name and no proxy server, so codes 12, 13
and 20 now return 0 with an empty string. The Wi-Fi codes (5-10) and
the proxy port (21) still throw. GuestNetCtl checks the three empty
answers and keeps the throw check for the rest; the libSceNetCtl debt
line says the same.
2026-10-15 06:00:49 +02:00
hypermist a4639ad2fb Merge upstream main into perf/vector-window-unindexed-slots 2026-10-15 16:02:16 +13:00
hypermistandClaude Opus 5.5 16914b8fa5 docs(debt): describe the narrowed vector window and its measurement
The relative vector addressing entry still said every window register
lives in one function-scope array. It now describes the array of the
bounded slots, the per-slot variables, the OpSwitch fallback and
APS5_NO_WINDOW_NARROWING, with the RTX 3060 measurement.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uzy15wqYTt6iWyxYXEzUWo
2026-10-15 16:01:41 +13:00
Dean a077a88df5 Merge pull request #5139 from Kikoarl/feat/ngs2-custom-module-user-fx
feat(ngs2): support custom submixer rack UserFx module 0x1d
2026-10-15 15:34:22 +13:00
fdfawef324 1ffc5f672b feat(agc): emulate per-pixel multisample coverage masks
Decode the four PA_SC_AA_MASK fields at the rasterized sample count. Use the native Vulkan mask when all four pixels agree and apply varying masks in the fragment shader, preserving helpers and combining coverage with alpha-to-coverage and shader mask exports. Add the normalized masks to pipeline, draw and shader keys and the versioned replay request.

Refuse unsupported conservative-raster, centroid and early depth/stencil memory-write cases. Synthetic readbacks cover driver submission, depth/stencil suppression, fragment stores and one-sample and four-sample coverage.
2026-10-15 13:00:34 +13:00
Dean ab9a476840 Merge pull request #5583 from BlizzyInc/fix/sample-through-1d
fix(shader): read explicit-LOD 2D samples through 1D T#s as measured
2026-10-15 12:34:15 +13:00
Dean 4bdfc9c801 Merge pull request #5631 from moong15/codex/skip-unused-pixel-stage
fix(agc): skip unused pixel stages with retained export formats
2026-10-15 12:33:48 +13:00
Adrià 2559e96233 Merge pull request #5531 from KauaSantos702/fix/name-psml-savedata-nids
fix(psml): name two exports that only had NIDs
2026-10-15 01:17:00 +02:00