Commit Graph

1753 Commits

Author SHA1 Message Date
alfalfa-star 124be3e7e8 feat(agc-driver): execute boolean SET_PREDICATION
SET_PREDICATION threw, and packets with the predicate header bit were
rejected. The executor now keeps the queue's predication: operations 3
and 4 read a 64- or 32-bit value and bit 8 selects whether predicated
packets run when it is non-zero or zero; operation 0 clears it. Before
a predicated packet runs while predication is active, queued labels are
recorded and the value is read, as for COND_EXEC; the packet is skipped
when the predicate fails.

Indirect buffers are inlined when a submission is copied, so a
predicated INDIRECT_BUFFER call keeps its header in front of the
inlined commands and records their end like a COND_EXEC range; the
block runs or is skipped on one evaluation, as on the command
processor. Query predication, a predicated COND_EXEC, predicated chains
and flips inside predicated command buffers throw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 21:02:47 +02:00
Dean 823e01e3c1
Merge pull request #706 from adriadam10/feat/libc-strtoimax-logbf
feat(libc): strtoimax and logbf
2026-10-06 07:58:43 +13:00
Dean af96cadf77
Merge pull request #701 from adriadam10/tools/progress-function-try
fix(tools): count function-try-block exports in progress.py
2026-10-06 07:58:01 +13:00
Dean 7580b9e44c
Merge pull request #679 from Celegans12/fix/relinker-windows-low-entropy-stacks
fix(relinker): keep Windows startup stacks below the guest arena
2026-10-06 07:57:17 +13:00
Dean cd79926080
Merge pull request #671 from NahuelGenchi/docs/fma-legacy-fused-assumption
docs: record the fused assumption of v_fma_legacy_f32 in TechnicalDebt
2026-10-06 07:56:35 +13:00
Dean cd8b6f3fcb
Merge pull request #662 from NumberGuan/codex/fix-autorun-exit-status
fix(relinker): decode autorun exit status for the host
2026-10-06 07:56:24 +13:00
Dean 69619c4a66
Merge pull request #657 from NumberGuan/codex/fix-strdup-allocation-failure
fix(libc): return null when strdup allocation fails
2026-10-06 07:55:41 +13:00
Dean 7058a4ce6c
Merge pull request #656 from NumberGuan/codex/fix-relinker-alignment
fix(relinker): reject invalid and overflowing alignment
2026-10-06 07:54:58 +13:00
Dean eabf1418de
Merge pull request #647 from Celegans12/feat/videoout-strict-colorimetry
feat(videoout): accept the STRICT_COLORIMETRY buffer option
2026-10-06 07:54:15 +13:00
Dean 3c681d5199
Merge pull request #670 from NahuelGenchi/feat/global-atomic-csub
feat(shader): implement global_atomic_csub
2026-10-06 07:54:05 +13:00
Dean d5b7fbc127
Merge pull request #660 from Celegans12/feat/agc-dpp16-row-share
feat(shader): implement the DPP16 row_share controls
2026-10-06 07:53:22 +13:00
Dean 7df0923570
Merge pull request #659 from Celegans12/feat/agc-image-atomics-32bit-formats
feat(agc): implement image atomics on 32_SINT and 32_FLOAT surfaces
2026-10-06 07:52:39 +13:00
Dean bbc6f42881
Merge pull request #667 from adriadam10/test/image-atomics-bitwise
test(shader): cover the bitwise and unsigned image atomics
2026-10-06 07:51:54 +13:00
Dean a509d519a1
Merge pull request #689 from adriadam10/test/flat-global-loads-ci-time
test(shader): split the flat and global loads test to keep it within CI's time limit
2026-10-06 07:51:41 +13:00
Dean 7b1d7cc78a
Merge pull request #688 from adriadam10/test/global-atomics-ci-time
test(shader): split the global atomics test to keep it within CI's time limit
2026-10-06 07:50:59 +13:00
Dean 18f1548703
Merge pull request #678 from Celegans12/feat/agc-clip-cntl-dx-linear-attr
feat(agc): accept linear attribute clipping in PA_CL_CLIP_CNTL
2026-10-06 07:50:16 +13:00
Dean 0a081cbe8c
Merge pull request #673 from Celegans12/feat/agc-pm4-cond-exec
feat(agc): implement COND_EXEC
2026-10-06 07:49:33 +13:00
Dean 5e68f0ad09
Merge pull request #654 from Celegans12/feat/agc-write-data-cache-policy
feat(agc): accept the WRITE_DATA cache policy
2026-10-06 07:48:51 +13:00
Dean 75aa7f2197
Merge pull request #651 from Celegans12/feat/agc-interpolant-mapping-f16-high
feat(agc): implement the interpolant mapping variant for high-half f16 inputs
2026-10-06 07:48:08 +13:00
Dean d9162684ee
Merge pull request #646 from Celegans12/fix/agc-get-is-trinity-mode
fix(agc): store sceAgcGetIsTrinityMode's flag through its out pointer
2026-10-06 07:47:55 +13:00
Dean a974aebf92
Merge pull request #728 from adriadam10/feat/agcdriver-submit-validation-names
fix(agcdriver): name the four SubmitValidation stubs from their NIDs
2026-10-06 07:47:13 +13:00
Dean f8cfceb2eb
Merge pull request #725 from adriadam10/feat/agc-unknown-names
fix(agc): name nine Unimplemented stubs from their NIDs
2026-10-06 07:46:30 +13:00
Dean 64e8667e7c
Merge pull request #687 from Celegans12/fix/agc-tessellation-feature
fix(agc): log the Vulkan features after tessellation is enabled
2026-10-06 07:45:46 +13:00
Dean fdd6519eac
Merge pull request #507 from adriadam10/feat/vop3-integer-clamp
fix(shader): saturate VOP3 integer mad/sad results on clamp
2026-10-06 07:27:34 +13:00
Celegans12 75e2e7252e fix(agc): log the Vulkan features after tessellation is enabled
The device constructor printed "Vulkan features tessellationAvailable"
before it read VkPhysicalDeviceFeatures and set tessellationShader, so
the line reported 0 on every GPU, including ones that enable the
feature. The rect-list and tessellation paths already read the enabled
value; only the diagnostic was wrong, and it suggested that
tessellation was unavailable.

Print the line right after the feature is enabled. The mesh, depth
clip and unrestricted depth range values it also reports are set
earlier and do not change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 20:20:50 +02:00
Dean 33e9a12159
Merge pull request #511 from adriadam10/feat/sdwa-vop2-float-selectors
feat(shader): accept every SDWA selector on VOP2 float ops
2026-10-06 07:13:44 +13:00
Dean b6c889d208
Merge pull request #625 from DotDebian/fix/mimg-address-instruction-dimension
fix(shader): locate image LOD, mip and sample index by the instruction's dimension
2026-10-06 07:13:30 +13:00
Adrià Franch ea65b7e5be fix(agcdriver): name the four SubmitValidation stubs from their NIDs
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-05 20:03:12 +02:00
Adrià Franch 357fd7e806 fix(agc): name nine Unimplemented stubs from their NIDs
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-05 20:01:01 +02:00
Adrià Franch ce4bdbf2eb feat(libc): strtoimax and logbf
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-05 19:22:12 +02:00
Adrià Franch 3299d56707 fix(tools): count function-try-block exports in progress.py
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-05 19:09:52 +02:00
Adrià Franch fa996bbccb fix(shader): saturate VOP3 integer mad/sad results on clamp
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-05 19:05:34 +02:00
boykopovar 0518f0e021
Merge pull request #677 from adriadam10/test/flat-cache-bits-ci-time
test(shader): keep the flat cache bits test within CI's time limit
2026-10-05 19:58:55 +03:00
Celegans12 d3e2e53a7c feat(videoout): accept the STRICT_COLORIMETRY buffer option
sceVideoOutRegisterBuffers2 and sceVideoOutSubmitChangeBufferAttribute2
threw for every buffer attribute option other than 0. PPSA26344 builds
its display buffers with option 8 through the libSceAgc helper linked
into it, so its first registration failed.

Option 8, VIDEO_OUT_BUFFER_ATTRIBUTE_OPTION_STRICT_COLORIMETRY (name
and value from KytyPS5), is now accepted and presented as option 0;
every other option still throws. What the console changes for it is
unknown and recorded in TechnicalDebt. The rejection now names the
tiling mode, pitch, aspect ratio and option it was given.

video_out_flip_tests decode checks that option 8 describes the same
buffer as option 0 and that options 1, 32 and 40 are rejected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 18:53:26 +02:00
boykopovar a4c290f50b
Merge pull request #644 from Celegans12/feat/psml-mfsr-unavailable
feat(psml): implement the MFSR 1100 calls for hardware without PSSR
2026-10-05 19:52:11 +03:00
boykopovar 71827e5c06
Merge pull request #641 from Celegans12/feat/libcinternal-thread-atexit
feat(libcinternal): run thread_local destructors at thread exit
2026-10-05 19:29:11 +03:00
Celegans12 823c3caf4f fix(relinker): keep Windows startup stacks below the guest arena
The PE writer marked relocatable executables HIGH_ENTROPY_VA. Windows
then places the main thread stack, TEB, PEB and the loader threads'
stacks, which exist before libc reserves the guest arena from
0x2_0000_0000, anywhere in the first TiB. Nearly half the time they
land inside the arena and stay there as holes that fixed guest
mappings cannot use.

DllCharacteristics is now 0x140 (DYNAMIC_BASE, NX_COMPAT). The image
is still relocated and bottom-up allocations keep the 8-bit
randomization, but they start near the bottom of the address space,
far below the arena. DLL placement does not depend on this flag.

windows_address_space checks the flags and, on Windows, runs a
relinked guest that returns the high dword of its stack pointer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:51:50 +02:00
Celegans12 776ecd3b35 feat(psml): implement the MFSR 1100 calls for hardware without PSSR
scePsmlMfsrGetContextBufferRequirement1100, scePsmlMfsrCreateContext1100
and scePsmlMfsrGetDispatchMfsrPacket1100 were not exported, so a title
importing them failed to load.

In Sony's libScePsml all three return 0x8A810001 (not initialized)
without writing their outputs until scePsmlMfsrInit has succeeded.
AnyPS5's scePsmlMfsrInit throws, so that is the only state a title can
reach, and the three calls now return that error.

The existing stubs for scePsmlMfsrInit, scePsmlMfsrReleaseContext and
scePsmlMfsrGetDispatchMfsrPacketSizeInDwords get their real names and
still throw. libScePsml_debug gets a CMakeLists.txt for the new
guest_psml test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:51:47 +02:00
Celegans12 2dea7164e3 feat(libcinternal): run thread_local destructors at thread exit
A title's own libc.prx implements __cxa_thread_atexit and the
destructor pass of exit() through _sceLibcInternalThreadAtexit and
_sceLibcInternalThreadDtors. Its __cxa_finalize calls
_sceLibcInternalForceTlsDestructor.

Destructors are kept per thread and run newest first, including those
registered while they run, as FreeBSD's __cxa_thread_call_dtors does.
A null destructor or one outside every loaded image throws instead of
being skipped. The first registration installs the pass as the
libkernel thread exit hook, so it runs on every guest thread before
the thread can be joined. _sceLibcInternalForceTlsDestructor throws.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:51:35 +02:00
Celegans12 61d2fb0a53 feat(agc): accept the WRITE_DATA cache policy
WRITE_DATA's control dword carries a two-bit cache policy in bits
26:25 (LRU, stream, no-allocate, bypass). Validate refused it, so a
submission with a WRITE_DATA built with a non-zero policy was rejected
as a whole.

The policy only steers how the GPU L2 keeps the written lines; the
stored words are the same, and Execute already writes them to guest
memory in queue order. The mask now accepts bits 26:25, as was done
for DMA_DATA's cache policy hints. The CE engine and the remaining
reserved bits still throw, and the message no longer names the cache.

agc_driver_pm4 stores both dwords of a WRITE_DATA with control
0x04100200 and checks that reserved bit 27 is still refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:51:17 +02:00
Celegans12 9df0de2990 feat(agc): implement COND_EXEC
Validate refused every COND_EXEC, so a submission that uses one was
rejected as a whole. The packet now reads the dword at its address once
the earlier packets of its queue and their GPU writes have completed,
and skips the exec_count dwords after it when the dword is zero.

The command copy that inlines INDIRECT_BUFFERs records where each range
ends, so a range over an INDIRECT_BUFFER skips the whole buffer.
Unaligned addresses, address bits 48 and up, and reserved control and
count bits throw; the cache policy is accepted on compute queues only,
as the MEC defines it. A flip inside a range, a range that ends inside
a packet or past its command buffer, and a chained INDIRECT_BUFFER or
REWIND inside a range throw.

agc_driver_pm4 and agc_driver_flip cover the skips and the rejections.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:51:11 +02:00
Celegans12 5e851fbb26 feat(agc): implement the interpolant mapping variant for high-half f16 inputs
PPSA26344 imports libSceAgc NID dbOlWdppb4o, whose name is unknown,
and calls it with the (regs, gs, ps) arguments of
sceAgcCreateInterpolantMapping to fill the 32 SPI_PS_INPUT_CNTL
registers. It is exported as sceAgcUnknownCreateInterpolantMapping.
It differs from sceAgcCreateInterpolantMapping only for inputs that
carry the high f16 half alone (is_f16 2): these take the default bit
and DEFAULT_VAL from the high half, as KytyPS5 does.

Both exports share validation and the register loop. More than 32
pixel shader inputs now throw; before, they were written past the
32-register block. agc_interpolant_mapping covers both exports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:51:09 +02:00
Celegans12 73c68c04bd feat(agc): implement image atomics on 32_SINT and 32_FLOAT surfaces
The resource materializer refused every atomic image descriptor whose
format was not 32_UINT. RDNA2 image atomics act on the raw dword and
the numeric format only affects addressing, so 32_SINT and 32_FLOAT
surfaces are now accepted with the Uint numeric class and run through
the existing integer atomics and float compare-exchange loops. Other
formats still throw, and the message now names the format.

DescriptorBinding gains imageAtomic, carried through the shader disk
cache (format version 4) and the resource content key. The driver
binds those elements through a cached R32_UINT view of R32_SINT and
R32_SFLOAT storage images.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:51:06 +02:00
Celegans12 51c98a3983 fix(agc): store sceAgcGetIsTrinityMode's flag through its out pointer
sceAgcGetIsTrinityMode takes a pointer to a one-byte flag; the only
known caller ignores the return value. The export took no argument and
never wrote the flag. That caller's flag is in zero-initialised .bss,
so this corrects the signature; it does not fix a visible failure.

The function now stores false, as sceKernelIsTrinityMode reports a base
PS5, returns 0 and throws on a null pointer, whose error code is
unknown. It moves from Unimplemented.cpp to Misc/src/Platform.cpp, and
the new agc_platform_tests ctest target covers it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:51:03 +02:00
Celegans12 f7ede9cd7d feat(shader): implement the DPP16 row_share controls
EmitDppTargetLane threw "DPP control 336 is not supported" for the
DPP16 row_share controls 0x150-0x15f. row_share:sel now reads lane
sel of the reading lane's own row, (lane & ~15) | sel, as the RDNA2
ISA defines it. The source never leaves the row, so the target is
always valid and an inactive source follows the existing fi and
bound_ctrl rule, as for row_xmask.

The new agc_driver_dpp16_row_share_xmask execution test covers
v_mov_b32, v_add_nc_u32, v_sub_nc_u32 and v_max_f32 with row_share
and row_xmask under a partial exec mask, with fi, bound_ctrl and
row/bank masks, as wave32 and wave64; row_xmask had no test before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:51:00 +02:00
Celegans12 2eff3c8386 feat(agc): accept linear attribute clipping in PA_CL_CLIP_CNTL
DecodeState and the draw precheck rejected PA_CL_CLIP_CNTL bit 24
(DX_LINEAR_ATTR_CLIP_ENA), so every draw that sets it was skipped.
Vulkan requires clipped NoPerspective outputs to vary linearly in
framebuffer space, and RADV and radeonsi set this bit for every draw
they emit. With the bit set the console therefore clips the way the
host driver already does, and the pipeline needs no extra state.
Clip space, depth clamping and the viewport depth range decode as
with the bit clear. Every other unsupported bit still rejects the
draw, with or without bit 24.

TechnicalDebt records that a clear bit, which was already accepted,
gets the same clipping.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:50:57 +02:00
boykopovar e248f404ef
Merge pull request #636 from Celegans12/feat/usbd-module
feat(usbd): add the libSceUsbd module
2026-10-05 18:46:17 +03:00
Adrià Franch 93d14fa5f4 test(shader): split the flat and global loads test to keep it within CI's time limit
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-05 17:32:46 +02:00
Adrià Franch 14a00e6963 test(shader): split the global atomics test to keep it within CI's time limit
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-05 17:19:12 +02:00
Adrià Franch 4066e6dd29 test(shader): keep the flat cache bits test within CI's time limit
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-05 16:54:53 +02:00