Commit Graph
14017 Commits
Author SHA1 Message Date
boykopovar 0a2f99147f Merge pull request #296 from Pouare514/feat/libSceJpegDec
feat(libSceJpegDec): implement JPEG decoding
2026-10-02 16:45:18 +03:00
boykopovar e00b491465 Merge pull request #286 from SP4C3B4R-8/feat/windows-mapping-hints
feat(libkernel): support mapping address hints and no-overwrite fixed mappings on Windows
2026-10-02 16:41:43 +03:00
DotDebianandClaude Opus 5.5 74fcea27f8 feat(libkernel): implement sceKernelMapNamedFlexibleMemoryInternal
libkernel did not export sceKernelMapNamedFlexibleMemoryInternal, which
the libc bundled with SDK 9 titles imports. It now forwards to
sceKernelMapNamedFlexibleMemory: the mapping counts against the flexible
budget, gets the range name and is released by sceKernelMunmap. Older
libc builds call the public function at the same sites with the same
arguments and result handling.

The known callers pass flag 0x8000, whose meaning is unknown. It is
still rejected as an unsupported mapping flag and is recorded in
TechnicalDebt.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 14:08:58 +02:00
Pouare514 c9ec561697 feat(libScePlayGoDialog): add PlayGo install dialog 2026-10-02 13:34:54 +02:00
Pouare514 8bd9670ab0 feat(libSceJpegDec): implement JPEG decoding 2026-10-02 13:34:41 +02:00
Pouare514 f1a3d60b15 fix(libkernel): boot Dreaming Sarah past unwind and debug raise 2026-10-02 13:34:35 +02:00
julienlgyandCopilot 2755aff9b1 feat(libSceAudio3d): add missing sceAudio3dPortClose stub
Co-authored-by: Copilot <[email protected]>
2026-10-02 12:46:50 +02:00
DotDebianandClaude Opus 5.5 dab1110556 feat(libkernel): implement sceKernelCancelSema
sceKernelCancelSema was a throwing stub. It now releases every thread
blocked in sceKernelWaitSema with SCE_KERNEL_ERROR_ECANCELED without
consuming tokens, sets the count to setCount (the initial count when
setCount is negative) and reports how many threads were waiting. A
setCount above the maximum returns SCE_KERNEL_ERROR_EINVAL and changes
nothing.

Waiters are counted separately from waiterCount, which is only
decremented when a waiter leaves, so two cancels in a row do not report
the same thread twice.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 11:57:00 +02:00
DotDebianandClaude Opus 5.5 d6cca762f4 feat(libkernel): support the CPU-time clocks in clock_gettime and clock_getres on Windows
CLOCK_THREAD_CPUTIME_ID (14) and CLOCK_PROCESS_CPUTIME_ID (15) threw
"unsupported clock_id" on Windows while the Linux branch already maps
them to the native clocks. clock_gettime now returns the user + kernel
time from GetThreadTimes / GetProcessTimes, and clock_getres reports the
clock interrupt period from GetSystemTimeAdjustment, which is the step
those counters actually advance by.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 11:40:22 +02:00
DotDebianandClaude Opus 5.5 7fd0890320 feat(libkernel): implement __elf_phdr_match_addr
Returns 1 when the address lies in an executable PT_LOAD segment of the
given dl_phdr_info, following FreeBSD lib/libc/gen/elf_utils.c (9.x and
11.x branches). The stub parameters become (dl_phdr_info*, void*) to
match the FreeBSD declaration; a null dl_phdr_info throws.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 11:18:06 +02:00
QDarkRex 508a9710ae fix(relinker): report TLS bounds failures at file offsets 2026-10-02 16:14:54 +07:00
DotDebianandClaude Opus 5.5 40d63b1b4c feat(libkernel): implement the sceKernelGetEvent* field accessors
sceKernelGetEventId, sceKernelGetEventFilter, sceKernelGetEventFflags,
sceKernelGetEventData and sceKernelGetEventUserData return the matching
field of the KernelEvent filled by sceKernelWaitEqueue and throw on a
null event. sceKernelGetEventError still throws NotImplemented.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 10:46:15 +02:00
QDarkRex 102e042a49 fix(relinker): bound guest TLS loads to the thread block 2026-10-02 15:45:50 +07:00
QDarkRex 721984a28f fix(relinker): load Windows guest TLS at signed displacements 2026-10-02 15:19:25 +07:00
boykopovar e1654a97e5 Merge pull request #259 from adriadam10/feat/vopc-compare-gaps
feat(shader): implement the missing non-f64 VOPC compares
2026-10-02 11:14:37 +03:00
boykopovar 8ed9e7ab5e Merge pull request #257 from adriadam10/feat/vop3-integer-gaps
feat(shader): VOP3 v_add/sub_nc_i32 (clamp), v_mul_lo_u16, 16-bit mads, v_ashrrev_i64
2026-10-02 11:13:30 +03:00
boykopovar 623c0d8dc6 Merge pull request #254 from adriadam10/fix/shader-writelane
fix(shader): select the written lane in v_writelane_b32
2026-10-02 11:13:02 +03:00
Dean Galvin 7ed138d13f fix(recompiler): start pixel waves without their helper invocations in EXEC
A pixel wave starts with EXEC holding its covered pixels. The other lanes of
a partly covered quad run as helpers outside EXEC until the shader asks for
whole quads with s_wqm. Pixel shaders started with every invocation in EXEC,
Vulkan's helper invocations included. Those take part in subgroup
operations, so they counted in ballots (v_mbcnt, s_bcnt1 of EXEC,
v_readfirstlane), and a wave's single ds_append or atomic could be performed
by one of them: an atomic in a helper invocation does nothing and returns an
undefined value.

The entry prologue now starts a pixel shader's EXEC as !gl_HelperInvocation,
through a new StageInputKind::HelperInvocation builtin input. s_wqm still
adds the helpers of every quad with a covered pixel, so derivative code keeps
them.

The agc_driver_pixel_helper_lanes execution test draws triangles that leave
partly covered quads across the target with a pixel shader that stores each
covered pixel's v_mbcnt rank in EXEC, the s_bcnt1 count of EXEC and the
v_readfirstlane of a pixel id. Every wave's covered pixels must be lanes
0..n-1 of an n-lane EXEC whose first lane is one of them, in wave64 and
wave32. It skips on a subgroup narrower than 32, such as lavapipe's.
2026-10-02 21:08:32 +13:00
Dean Galvin 151fec7fd6 fix(videoout): read the open param as the service thread's priority and affinity
and throws for any non-zero word after it. Its layout matches shadPS4's
ServiceThreadParams instead: an unknown first word (16), a set-priority flag
and a priority (256..767), a set-affinity flag and a 64-bit CPU mask at
offset 16. PPSA21564 passes 16, 1, 0x100, 1 and 0x1FFF, so it stops at
startup on main.

sceVideoOutOpen now validates each field and reads the mask only when its
flag is set, so a 16-byte param with both flags clear still works. The
priority and affinity are not applied, since the present and vblank threads
are host threads; this and the unknown first word are listed in the
technical debt.
2026-10-02 21:05:25 +13:00
Adrià FranchandClaude 58f90eea9d feat(libScePngEnc): implement PNG encoding
scePngEncQueryMemorySize, scePngEncCreate, scePngEncEncode and
scePngEncDelete encode R8G8B8A8 and B8G8R8A8 images with a pitch into
RGB or RGBA PNGs using the shared encoder in core/Decoder/Png.
Decoder::Png::Encode takes optional compression level and filter
options so the encode parameters are honoured.

Co-Authored-By: Claude <[email protected]>
2026-10-02 10:00:32 +02:00
Adrià FranchandClaude 3033e5e554 feat(shader): implement s_movrels/s_movreld (b32, b64) and s_movrelsd_2_b32
s_movrels reads SGPR[src + M0] and s_movreld writes SGPR[dst + M0].
The 64-bit forms align the offset down to even (M0 & ~1), and
s_movrelsd_2_b32 takes the source offset from M0[9:0] and the
destination offset from M0[25:16], as measured on hardware. They use
the same select-over-registers lowering as the vector forms, over the
106 SGPRs. The embedded vertex-fetch scan forgets every tracked SGPR on
a relative write.

Co-Authored-By: Claude <[email protected]>
2026-10-02 09:59:59 +02:00
Adrià FranchandClaude f3f9b4fff7 feat(shader): implement s_bcnt0_i32_b64, s_ff0_i32_b64, s_flbit_i32(_i64), s_quadmask_b32
The decoder threw for these SOP1 opcodes. The 64-bit find-first-zero and
signed leading-bit counts reuse the existing 64-bit helpers with a flag;
s_quadmask_b32 is the 32-bit half of s_quadmask_b64. s_bcnt0 and s_quadmask
set SCC to result != 0; the find and leading-bit forms leave it.

Co-Authored-By: Claude <[email protected]>
2026-10-02 09:59:47 +02:00
Adrià FranchandClaude 24f959b48c fix(shader): select the written lane in v_writelane_b32
The WriteLane IR takes {value, lane, previous}, as the translation and the
read-lane eliminator use it, but the SPIR-V emitter compared the lane id with
the previous value and selected between the lane index and the value. Every
v_writelane therefore wrote its value to all lanes (or the lane index to the
lane whose old value happened to equal its id).

Co-Authored-By: Claude <[email protected]>
2026-10-02 09:59:37 +02:00
boykopovar 01eaae0bf9 Merge pull request #253 from adriadam10/feat/shader-cache-hint-noops
feat(shader): decode cache invalidations and performance hints as no-ops
2026-10-02 10:50:20 +03:00
boykopovar 9b3927b4ea Merge pull request #252 from adriadam10/feat/vop3-f16-ubyte-aliases
feat(shader): VOP3 v_max/min_f16, v_cvt_f32_f16/ubyte and abs/neg on f16 binaries
2026-10-02 10:49:58 +03:00
boykopovar 29364c33d8 Merge pull request #248 from adriadam10/feat/ngs2-atrac9
feat(libSceNgs2.native): decode ATRAC9 sampler voices, parse and size ATRAC9 waveforms
2026-10-02 10:47:15 +03:00
boykopovar 4eab28c1fa Merge pull request #241 from adriadam10/feat/audio-legacy
refactor(audio): drop duplicated stub exports from libSceAudio
2026-10-02 10:35:29 +03:00
boykopovar 194ea62ff9 Merge pull request #228 from adriadam10/feat/ajm-from-native
refactor(ajm): drop duplicated stub exports from libSceAjm and libSceAjmi
2026-10-02 10:35:05 +03:00
boykopovar a0eb90559e Merge pull request #237 from adriadam10/fix/ajm-mp3-s16p
fix(ajm): convert planar 16-bit MP3 output from FFmpeg
2026-10-02 10:34:44 +03:00
boykopovar 409c41cc6a Merge pull request #236 from adriadam10/feat/audiodec
feat(libSceAudiodec): decode MP3, M4AAC and ATRAC9
2026-10-02 10:34:11 +03:00
boykopovar 8cad51d19e Merge pull request #247 from adriadam10/feat/ngs2-core
feat(libSceNgs2.native): implement system, racks, voices and PCM rendering
2026-10-02 10:33:53 +03:00
boykopovar 2d0e706fc7 Merge pull request #246 from oneandonlydean/fix/agc-keys-fill-clear-hold
fix(agc): end a key fill's hold when the fill clears the image at once
2026-10-02 10:33:28 +03:00
boykopovar 08e6a57662 Merge pull request #251 from adriadam10/ci/gpu-tests-lavapipe
ci: run the shader execution tests on lavapipe
2026-10-02 10:32:21 +03:00
boykopovar fbfe6bb13b Merge pull request #249 from MichonGoddijn231849/fix/fast-texture-filled-keys
fix(agc): the stage-A fast path leaves a view of a pending image whose keys were filled to the full lookup
2026-10-02 10:30:29 +03:00
Adrià FranchandClaude 69bd750c46 feat(libSceNgs2.native): decode ATRAC9 sampler voices, parse and size ATRAC9 waveforms
Co-Authored-By: Claude <[email protected]>
2026-10-02 09:24:46 +02:00
Adrià FranchandClaude 90295d3733 feat(libSceNgs2.native): implement system, racks, voices and PCM rendering
libSceNgs2 keeps its stubs; its types now come from the .native header.

Co-Authored-By: Claude <[email protected]>
2026-10-02 09:24:46 +02:00
Adrià FranchandClaude 569c2ec56c feat(libSceAudiodec): decode MP3, M4AAC and ATRAC9
All six exports are implemented: MP3 and AAC (ADTS or raw blocks) are
decoded with the bundled FFmpeg and ATRAC9 with LibAtrac9, one unit per
call, into interleaved S16 or float PCM, with the libSceAudiodec
validation and error codes. libSceAudiodec.native is built from the same
sources.

Co-Authored-By: Claude <[email protected]>
2026-10-02 09:22:59 +02:00
Adrià FranchandClaude 2036697758 fix(ajm): convert planar 16-bit MP3 output from FFmpeg
Co-Authored-By: Claude <[email protected]>
2026-10-02 09:20:45 +02:00
Adrià FranchandClaude e3fa37f60a refactor(audio): drop duplicated stub exports from libSceAudio
Co-Authored-By: Claude <[email protected]>
2026-10-02 09:16:34 +02:00
Adrià FranchandClaude 14e13219ee refactor(ajm): drop duplicated stub exports from libSceAjm and libSceAjmi
Co-Authored-By: Claude <[email protected]>
2026-10-02 09:16:34 +02:00
boykopovar c00bc19c0d Merge pull request #222 from YossiYad/feat/windows-tls-load-registers
feat(relinker): load the fs:[0] thread pointer into any register in Windows guest code
2026-10-02 10:06:12 +03:00
boykopovar 56aa800ef0 Merge pull request #220 from asimplestray/feat/shader-sop1-saveexec
feat(shader): implement SOP1 saveexec/wrexec family
2026-10-02 09:46:06 +03:00
boykopovar 5544b774e3 Merge pull request #292 from MichonGoddijn231849/split/offline-services
feat(libs): offline services GTA V reaches in Story Mode
2026-10-02 09:45:03 +03:00
Alberto RuizandClaude Opus 5.5 1b2af06c92 fix(json2): reject documents nested deeper than 512 levels
The parser descends recursively into every array and object without a
limit, so deeply nested input exhausts the stack and crashes the
process: 50000 levels on an 8 MB main thread and 5000 levels (10 KB of
brackets) on a 256 KB thread. sce::Json::Parser::parse now returns
JsonErrorParse when a document opens more than 512 nested arrays or
objects, which bounds the recursion for any input.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R5WJS4ZdQynAJesCZKH5hb
2026-10-02 08:08:37 +02:00
Adrià FranchandClaude 7d90b1dcec feat(shader): implement s_memtime and s_memrealtime
Both SMEM opcodes read a 64-bit counter into an SGPR pair. They now
lower to OpReadClockKHR: s_memtime with subgroup scope (the shader
clock) and s_memrealtime with device scope (the constant real-time
clock). The device enables VK_KHR_shader_clock when it has both clocks
and the backend refuses the opcodes with a clear reason otherwise.

Co-Authored-By: Claude <[email protected]>
2026-10-02 07:58:41 +02:00
Dean Galvin dc8a716930 fix(shader): wrap the v_readlane_b32 lane select at the wave size
The hardware reads the lane select modulo the wave size (S1[4:0] in wave32,
S1[5:0] in wave64), as ReadLaneEliminator already assumes with
selector % waveSize. On the single-subgroup path EmitReadLane passed the raw
select to OpGroupNonUniformShuffle, which is undefined for an id at or above
the subgroup size. It is now masked with WaveSize() - 1, like v_writelane_b32.
The two-lane wave64 path already wrapped.
2026-10-02 18:23:56 +13:00
Adrià FranchandClaude c8af88921a feat(shader): implement the missing 32-bit LDS atomics and fix ds_min/max_f32
ds_rsub(_rtn)_u32, ds_inc_u32, ds_dec_u32, ds_mskor(_rtn)_b32,
ds_cmpst(_rtn)_b32/f32, ds_add(_rtn)_f32, ds_min/max_rtn_f32,
ds_wrap_rtn_b32 and ds_nop threw in the decoder. The new ones run as a
compare-exchange loop over the old value, with the semantics measured on an
RDNA2 GPU.

ds_min_f32 and ds_max_f32 take one data operand on gfx10, but compared the
memory with a second register (the unused data1 field, usually v0) and
stored data0 when that compare held. They now keep the minimum/maximum of
memory and data like the hardware: a NaN loses to a number, -0 < +0. Both
IR ops return the old value, so the _rtn forms share them.

Co-Authored-By: Claude <[email protected]>
2026-10-02 07:11:48 +02:00
Adrià FranchandClaude 8fd19cda0e feat(shader): implement f16 ldexp/frexp/norm/class, v_sat_pk_u8_i16 and v_mul/mac_legacy_f32
v_ldexp_f16, v_frexp_mant_f16, v_frexp_exp_i16_f16, v_cvt_norm_i16/u16_f16,
v_cvt_pknorm_i16/u16_f16, v_cmp_class_f16, v_cmpx_class_f16,
v_sat_pk_u8_i16 and v_mul/mac_legacy_f32 threw in the decoder. The
behaviour was measured on an RDNA2 GPU: ldexp takes the exponent as an i16,
the norm conversions round to nearest even (done in integers, as x * 32767
does not fit f32 exactly), and a legacy multiply with a zero operand gives
+0 even for an infinite or NaN other operand. v_mac_legacy_f32 adds the
rounded product, like v_mac_f32.

Co-Authored-By: Claude <[email protected]>
2026-10-02 06:46:26 +02:00
Adrià FranchandClaude 9e0060cb37 fix(shader): keep fused multiply-adds fused and v_mad/v_mac_f32 rounded twice
SPIR-V float ops without NoContraction let the driver fuse or split them:
RADV contracted a guest v_mul_f32 + v_add_f32 into one fma, which made the
f32 division macro one ulp off. f32 add, sub, mul and fma now carry
NoContraction.

v_mad_f32, v_mac_f32, v_madmk_f32 and v_madak_f32 round the product before
the add, unlike their v_fma*/v_fmac* counterparts, but all of them were
translated to FPFma32. They now use a new FPMad32, emitted as a separate
NoContraction multiply and add.

Co-Authored-By: Claude <[email protected]>
2026-10-02 06:41:03 +02:00
Adrià FranchandClaude 7c753c336e fix(shader): round f32 to f16 to nearest even on every driver
f32 to f16 conversions (every f16 VALU result, v_cvt_f16_f32, f16 image
stores) used GLSL packHalf2x16, whose rounding is implementation-defined.
RADV truncates, so f16 results were off by one ulp and overflowed to
65504 instead of infinity. The conversion is now done with integer
operations: round to nearest even, subnormals, overflow to infinity and
quiet NaNs, as RDNA does. v_cvt_pkrtz keeps its own truncating op.

Co-Authored-By: Claude <[email protected]>
2026-10-02 06:40:10 +02:00