Commit Graph
14017 Commits
Author SHA1 Message Date
Adrià a0fa346f40 Merge pull request #944 from Celegans12/feat/agc-sint-storage-images
feat(agc): implement sint storage images through uint views
2026-10-07 13:56:17 +02:00
Raihan Abdul MajidandClaude Opus 5.5 8c5b9ee5da fix(agc): exclude tests and tools from the shader cache guard when the source path holds regex characters
The exclusion regex embedded CMAKE_CURRENT_SOURCE_DIR, so a checkout under a path such as "Local Disk (D)" never matched and the shader disk cache key check failed on the test sources. Glob relative to the source directory and match only the relative prefix; add_shader_recompiler already resolves relative guard sources against CMAKE_CURRENT_SOURCE_DIR.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 18:56:11 +07:00
jeffrey12cali cb2a29d810 docs(build): say that the libs target is not part of the default build 2026-10-07 13:52:18 +02:00
Adrià 931109b308 Merge pull request #866 from Celegans12/feat/agc-srgb-load-fallback
feat(agc): implement 8 and 8_8 srgb image loads through unorm views
2026-10-07 13:49:58 +02:00
Adrià c81f573691 Merge pull request #954 from CnRJay/feat/ds-wrxchg2-rtn-b64
feat(shader): implement ds_wrxchg2_rtn_b64 and ds_wrxchg2st64_rtn_b64
2026-10-07 13:44:28 +02:00
Madan Kumar 47c1b8e592 fix(libc): only fail sscanf_s fields when the buffer capped the width
A %s or %[ field was treated as overflowed whenever the next input
character could continue it, even when the field width from the format
ended the read. sscanf_s("abcdef", "%3s", buf, 10) returned 0 with an
empty buffer instead of 1 with "abc". Run the overflow check only when
the buffer capacity reduced the width.
2026-10-07 16:25:11 +05:30
kjhq 63af67138f feat(libSceNet): export in6addr_any and in6addr_loopback
libSceNet exports the IPv6 wildcard and loopback addresses as data.
2026-10-07 10:43:24 +00:00
kjhqandClaude Opus 5.5 1cc4d25c04 feat(libSceHttp2): complete asynchronous requests through the kqueue option
sceHttp2SendRequestAsync no longer fails synchronously: it queues a
completion carrying the network error and triggers the user event named
by the kqueue option. sceHttp2WaitAsync returns queued completions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 10:39:14 +00:00
Aarav 8ab22b0954 fix(relinker): escape control characters in call registry JSON 2026-10-07 16:05:40 +05:30
kjhqandClaude Opus 5.5 afb8d8e2d7 fix(libkernel): accept guest socket addresses whatever their sa_len
The FreeBSD kernel ignores sa_len in a socket address passed in and sets
it from the length argument, so titles may leave it 0. Only the family
and the length argument decide the address kind now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 10:34:23 +00:00
Claude 121d9332b5 build(libs): strip the MinGW static runtime flags once for all libraries
Every library CMakeLists.txt ended with the same block removing -static,
-static-libgcc and -static-libstdc++ from CMAKE_EXE_LINKER_FLAGS on MinGW,
because core/libs/CMakeLists.txt only removed them after adding the library
directories. Remove them before the libc and library directories are added
so each directory inherits the stripped flags, and drop the 52 copies.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_017pTZqAyVSZy2FZmaqakPHZ
2026-10-07 10:10:38 +00:00
TideOPLandClaude Opus 5.5 71e0f6428f style(libScePad): remove code comments
Per CONVENTIONS, code comments only mark technical debt.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 11:06:09 +01:00
TideOPLandClaude Opus 5.5 efa6cd56f0 fix(libScePad): queue input states for scePadRead
scePadRead reported only the current state, so input that changed and
changed back between two reads was lost. Published states are now kept in
a queue of up to 64 and drained oldest first; with none queued the current
state is returned as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 11:03:30 +01:00
TideOPLandClaude Opus 5.5 efa5afbfbd fix(libkernel): read the process start before the clock in process time
sceKernelGetProcessTime and sceKernelGetProcessTimeCounter subtracted
GetStartNanos() from GetMonotonicNanos() in one expression. GCC reads the
clock first, so on the first call in a process the start was captured
after it and the result wrapped to about 2^64.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 11:03:30 +01:00
Muhammad Umair f2b6b5a1a9 fix(oracle)!: require explicit float modes
BREAKING CHANGE: CLI and Python callers must supply all seven float
controls. Add clamp, rounding and FP16 overflow settings so hardware
measurements cannot silently use an unintended mode.

Refs #981
2026-10-07 14:58:28 +05:00
Celegans12 6e34e8614e feat(agc): implement sint storage images through uint views
Storage images of a SINT format threw "storage image descriptor uses
an unsupported format"; only write-only 32_SINT was accepted.

The recompiler now writes 16_SINT, 8_8_SINT, 32_SINT, 16_16_SINT,
8_8_8_8_SINT, 32_32_SINT, 16_16_16_16_SINT and 32_32_32_32_SINT
storage images with the Uint numeric class. 8- and 16-bit components
are saturated (EmitFormatStoreComponent) and 32-bit ones stored
unchanged, as measured on RDNA2 (gfx1035); image_store_pck stores
32-bit components unchanged too. The driver binds these surfaces
through a cached view of the same-size UINT format.

8_SINT, 32_32_32_SINT, the packed SINT formats (11_11_10, 10_11_11,
2_10_10_10, 10_10_10_2), D16 stores, packed stores of 8- and 16-bit
components and atomics other than 32-bit ones on 32_SINT and 64-bit
ones on 32_32_SINT still throw. New test: agc_driver_image_store_sint,
with DST_SEL X,Y,0,1 on the two-channel formats, as with X,Y,Z,W the
hardware writes channel 1 from the W data slot (TechnicalDebt).
2026-10-07 11:56:04 +02:00
Celegans12 91852719bf feat(agc): implement 8 and 8_8 srgb image loads through unorm views
NVIDIA 610.62 cannot sample R8G8_SRGB, and lavapipe can sample neither
it nor R8_SRGB, so an 8_8 sRGB T# made an image the device does not
support: creating it crashes the NVIDIA driver and lavapipe loads zeros.

The device's format support is read once. An 8 or 8_8 sRGB texture the
device cannot sample is created and viewed as R8_UNORM or R8G8_UNORM,
and SpirvTarget::srgbDecodeFormats makes the materializer mark the
image, so image loads map every channel through a 256-entry table of
the sRGB EOTF rounded to nearest even at bf16 precision, which is what
RDNA2 (gfx1035) returns; both channels of 8_8 are sRGB, and DST_SEL 0
and 1 map to themselves. Samples and gathers of such an image throw,
and its bindless table entries are unmapped like converted formats.
APS5_SRGB_SHADER_DECODE=1 takes this path on every device. Shader disk
cache entries and keys carry the mark: cache format version 7.
2026-10-07 11:52:08 +02:00
Celegans12 0d38698dfe fix(agc): include PA_SU_POLY_OFFSET_CLAMP in the initial context state
A draw with depth bias enabled read PA_SU_POLY_OFFSET_CLAMP (context
register 0x2df) with read(), but the context bank only held it once
the title wrote it. Titles that rely on the reset value had every such
draw skipped with "missing register in context bank at DWORD 0x2df".

The initial context state, which CLEAR_STATE also restores, now holds
the register as 0. That is the value in libSceAgc's own register
defaults (sceAgcGetRegisterDefaults2, every version) and in amdgpu's
GFX10 clear-state table. A clamp of 0 means no clamping, so it needs
no device feature.
2026-10-07 11:46:11 +02:00
Adrià 0d3c1eec89 Merge pull request #934 from CnRJay/feat/agc-color-compare-offsets
feat(agc): accept texel offsets, LOD biases and LOD clamps in color comparison sampling
2026-10-07 11:41:50 +02:00
alfalfa-starandClaude Opus 5.5 57a529d5bf feat(videoout): use sce_sys/icon0.png as the window icon
The display window now takes its icon from /app0/sce_sys/icon0.png when
the game has one, decoded with the existing PNG decoder and set through
SDL_SetWindowIcon. Linux executables have no icon resource, so the
window, taskbar and alt-tab showed a generic icon; on Windows the
embedded resource from #350 already covers this and the call only
reinforces it. Without icon0.png nothing changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 11:41:26 +02:00
Adrià FranchandClaude f1fe7f3678 docs: describe the ds_wrxchg2 b64 forms in the measured b32 entry
Co-Authored-By: Claude <[email protected]>
2026-10-07 11:40:52 +02:00
ChadandClaude Opus 5.5 5582c993e2 feat(shader): implement ds_wrxchg2_rtn_b64 and ds_wrxchg2st64_rtn_b64
DS opcodes 0x6e and 0x6f exchange two qwords at offset0 and offset1
scaled by 8 (st64: 512) and return both old values. Each address is
exchanged with its own 64-bit LDS exchange on the locked 64-bit path.
Equal offsets and a destination past v255 throw, as for the b32 forms;
64-bit GDS throws like the other 64-bit DS atomics.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 11:40:39 +02:00
Claude 2eebe84f25 feat(agc): accept texel offsets, LOD biases and LOD clamps in color comparison sampling
Comparison sampling of a color texture threw on the _o, _b and _cl
forms and on a sampler LOD bias. The emulation fetches the texels
itself, so the 6-bit offsets of the address are added to the point or
bilinear texel indices, as on the hardware and in Vulkan. The emulation
runs only at level zero or on a single-level view, where an LOD bias or
clamp cannot select another level, so they are accepted with no effect.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 11:30:00 +02:00
SP4C3B4R-8andClaude Opus 5.5 57588cf2dd fix(libSceFiber): pin fiber contexts writable under write tracking on Windows
Write tracking protects shared guest pages read-only. A push on a fiber
stack in such a page faults, and Windows cannot dispatch it because the
exception frame lands on the same protected stack, so the process was
terminated without a report. Pin fiber contexts writable for their
lifetime; pinned pages are always collected as written.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 11:25:48 +02:00
Adrià 878e6a6b41 Merge pull request #932 from CnRJay/feat/image-gather-1d-offsets
feat(shader): accept texel offsets in 1D gathers
2026-10-07 11:25:41 +02:00
Adrià 9a1c12f3d9 Merge pull request #919 from MichonGoddijn231849/fix/coherent-dwordx2-atomic-load
fix(recompiler): read a coherent dwordx2 as one 64-bit atomic load
2026-10-07 11:21:00 +02:00
Claude cc4d8ec07e refactor(recompiler): dispatch image atomics through ImageOpcodeInfoOf
EmitImage listed all 27 image atomic opcodes by hand to reach
EmitAtomicOp, although it already looks up ImageOpcodeInfoOf for the
instruction. Route every opcode whose access is ImageAccess::Atomic to
EmitAtomicOp before the switch; the set of opcodes is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_017pTZqAyVSZy2FZmaqakPHZ
2026-10-07 09:19:01 +00:00
Adrià 4d1a356d43 Merge pull request #928 from MichonGoddijn231849/fix/scalar-sop1-movrelsd
fix(shader): read relative SGPRs through a one-hot mux
2026-10-07 11:16:35 +02:00
TideOPLandClaude Opus 5.5 cefb5a9fc0 docs(libScePad): record the scePadRead queue gap in technical debt
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 10:15:39 +01:00
Adrià FranchandClaude 9e7c59962e test(recompiler): drop the comments in the look-back scan test
Co-Authored-By: Claude <[email protected]>
2026-10-07 11:09:17 +02:00
Michon 58eb55dddf test(recompiler): a hand-written look-back kernel instead of the game's; record the dwordx2 loads that can still tear
LookBackScan runs a 43-instruction decoupled look-back written for the
test: one aggregate per block, the block index from an atomic counter,
{flag, value} published with buffer_atomic_swap_x2 and read back with
glc buffer_load_dwordx2. Seven single look-backs and 50 scans of 4096
blocks are checked against a CPU prefix sum; without the recompiler
change the first whole scan fails (3 of 3 runs).

TechnicalDebt records that only glc, aligned, in-bounds dwordx2 loads
in programs with the 64-bit storage view are one atomic load: loads
without glc, and loads in programs without 64-bit buffer atomics, can
still tear against a concurrent swap_x2.
2026-10-07 11:09:04 +02:00
MichonandClaude Opus 5.5 55447e1c77 fix(recompiler): read a coherent dwordx2 as one 64-bit atomic load
A glc buffer_load_dwordx2 is one 64-bit access on the GPU, so it never
sees half of a buffer_atomic_swap_x2. It was emitted as two dword loads,
which can: the first can read the flag from before the swap and the
second the value from after it.

GTA V gives its BVH nodes their record indices with a single-pass
decoupled look-back prefix sum. Each workgroup publishes a {flag, value}
pair for its block with buffer_atomic_swap_x2 and reads the previous 64
blocks' pairs with glc dwordx2 loads. A torn read counts earlier blocks
twice, two nodes then share records, the BVH is corrupt and the ray
tracing refit hangs. It only happens in scans of more than 64 blocks (the
largest BVHs) and depends on timing.

In a program that has the u64 storage-buffer view (it uses 64-bit buffer
atomics), a coherent raw two-dword buffer load that is 8-byte aligned and
in bounds is now read with one device-scope OpAtomicLoad on that view and
split with OpUConvert and a shift (not OpBitcast to a uvec2, which
crashes NVIDIA's shader compiler). All other loads keep the per-dword
path.

tests/execution/LookBackScan runs the game's scan kernel: the look-back
from given blocks, and 50 whole 125-block scans checked against a CPU
prefix sum. Without this change the first whole scan fails.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-07 11:08:58 +02:00
Adrià e2b527bb09 Merge pull request #295 from MichonGoddijn231849/split/pixel-ancillary
fix(shader): packed pixel ancillary as SampleId and Layer, gl_Layer via Geometry, Z export formats
2026-10-07 11:06:33 +02:00
Dean 57e9f0d6aa Merge pull request #734 from alfalfa-star/feat/ppsa14632-missing-exports
feat(libs): declare the exports PPSA14632 imports that no library provides
2026-10-07 22:00:08 +13:00
Dean dc4d9a16b7 Merge pull request #828 from MathiasDevelopes/claude/gifted-meitner-oi88g5
fix(savedata): serialize mount slot access in libSceSaveData.native
2026-10-07 21:59:38 +13:00
Dean c0b452e649 Merge pull request #1057 from MathiasDevelopes/claude/project-thread-2tinn8
refactor(libSceAvPlayer): build libSceAvPlayer.native from shared Export.cpp
2026-10-07 21:59:08 +13:00
Dean c644f46b22 Merge pull request #1041 from NahuelGenchi/test/drop-recompiler-stub-test
test(agc): drop the recompiler stub test
2026-10-07 21:58:38 +13:00
Adrià 46f2050eb5 Merge pull request #896 from alfalfa-star/feat/image-atomic-64
feat(recompiler): implement 64-bit image atomics
2026-10-07 10:54:09 +02:00
LeandroLP23andClaude Opus 5.5 db26339a5f fix(agc): release the current address space with the image mirrors
ClearImageMirrors drops the mirror map before the device is destroyed,
but the current address space in Spaces() still held its mirrors, so
they were freed by the cache's static destructor from the driver's DLL
detach, after the Vulkan driver was unloaded, and every exit crashed on
Windows. The teardown now releases the current address space too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 10:53:33 +02:00
Adrià 219a1cf8d2 Merge pull request #916 from adriadam10/feat/s-bfe-i64
feat(shader): implement s_bfe_i64
2026-10-07 10:36:58 +02:00
alfalfa-starandClaude Opus 5.5 1e28efbd26 feat(agc): accept 64-bit image atomics in graphics shaders
A pixel or vertex shader with a 64-bit image atomic declares Int64Atomics,
Int64ImageEXT and SPV_EXT_shader_image_int64, which graphics shader
validation rejected ("SPIR-V requires unsupported device capability"),
so the draw was dropped. Compute dispatches are not validated this way.

The device records whether it enabled shaderImageInt64Atomics
(imageInt64Atomics in the device state and the graphics Context), and
ValidateShaders accepts the two capabilities and the extension when it
did.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 10:35:24 +02:00
alfalfa-starandClaude Opus 5.5 9df592926b feat(recompiler): implement 64-bit image atomics
image_atomic_* with a two-dword data mask (four for cmpswap) is the
64-bit form of an integer image atomic. The decoder rejected it with
"invalid MIMG data mask". PPSA14632 (Unreal Engine) uses
image_atomic_umax this way in a compute shader during its first frames.

Swap, add, sub, signed and unsigned min/max, and, or, xor and cmpswap
now decode with 64-bit data and translate to new ImageAtomic*64 IR
opcodes. An image updated by them gets its own descriptor binding
range, declared as an R64ui image of 64-bit integers, and the module
uses Int64ImageEXT from SPV_EXT_shader_image_int64. The driver enables
shaderImageInt64Atomics when the device offers it and binds an
R64_UINT view of the 32_32 UINT, SINT or FLOAT surface. Without the
feature, recompiling such a shader throws.

64-bit inc, dec and the float atomics still throw, as does any other
access in the same shader to an image it updates with 64-bit atomics.

The new agc_driver_image_atomics64 test runs every operation on 32_32
UINT, SINT and FLOAT surfaces and checks the returned and stored values
against edge cases across the dword boundary.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 10:21:32 +02:00
Adrià fbf3d6da87 Merge pull request #869 from ahir061/fix/preserve-pixel-export-mapping
fix(shader): preserve pixel export mappings in replay
2026-10-07 10:16:53 +02:00
Adrià cffaab57ee Merge pull request #894 from alfalfa-star/fix/structurizer-shared-merge-budget
fix(recompiler): merge a loop selection where its other arm joins or leaves
2026-10-07 10:10:00 +02:00
Michon 048d9982cd fix(agc): the Z-format precheck gives no verdict for a missing SPI_SHADER_Z_FORMAT
DrawRejection read 0x1c4 with read(), which throws when the register is
absent, against the function's rule that a missing register gives no
verdict there; it now reuses the value read with value() for the
DB_SHADER_CONTROL check. Tests pin the Z-export rules: formats 1, 2, 3
and 9 with Z_EXPORT_ENABLE accepted, format 0 rejected, the sample-mask
export accepted with 32_ABGR and rejected with 32_R, formats 4 to 8
rejected, and a missing 0x1c4 accepted.
2026-10-07 10:09:51 +02:00
LeandroLP23andClaude Opus 5.5 ac9287c2ef refactor(recompiler): share the stage input info helpers
StageOf, VertexInfo, PixelInfo and ShaderWorkgroupInput were defined
in the anonymous namespaces of up to three SPIR-V backend sources with
identical bodies; they are now declared next to FailEmit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 10:03:28 +02:00
Adrià 80d4f6b716 Merge pull request #833 from LeandroLP23/fix/shader-lds-lock-uniform-exit
fix(shader): serialize locked LDS updates with a wave-uniform loop exit
2026-10-07 09:57:07 +02:00
Adrià 2a12b6833f Merge pull request #815 from Celegans12/feat/agc-sampler-reduction-mode
feat(agc): implement min and max sampler reduction modes
2026-10-07 09:40:20 +02:00
Adrià d4c196c207 Merge pull request #832 from MathiasDevelopes/claude/spirv-fail-emit-helper
refactor(recompiler): share the SPIR-V emission failure helper
2026-10-07 09:34:20 +02:00
Adrià FranchandClaude 9213355711 docs(TechnicalDebt): record measured min/max reduction footprint
Co-Authored-By: Claude <[email protected]>
2026-10-07 09:22:02 +02:00