Commit Graph

6138 Commits

Author SHA1 Message Date
SamG-Coder 4cd8e35366 fix(shader): preserve NGG passthrough launch and primitive inputs 2026-10-01 20:43:17 +10:00
boykopovar 131156c5d0
Merge pull request #209 from ljkx/feat/clzero-to-intel
feat(relinker): lower CLZERO for --to-intel
2026-10-01 13:43:09 +03:00
SamG-Coder 785c24e652 fix(shader): derive mesh launch state from guest wave size 2026-10-01 20:42:49 +10:00
SamG-Coder 7fea9dec9b test(agc): build mesh smoke test on Windows 2026-10-01 20:42:49 +10:00
boykopovar c088b87399
Merge pull request #210 from boykopovar/refactor/agc-driver-exec-cpp
Refactor/agc driver exec cpp
The driver for the libSceAgcDriver library written in #5 turned out to be at least four times more performant than the one originally included in the project. However, the Driver.cpp file turned out to be too large; it is now split into multiple files located in subfolders (the include structure is the same). The behavior remained unchanged.
2026-10-01 13:38:50 +03:00
SamG-Coder dfdbeae901 fix(shader): preserve comparison image flags in disk cache 2026-10-01 20:36:28 +10:00
boykopovar 4a82f04113 refactor(agc): organize driver modules into subdirectories 2026-10-01 13:31:24 +03:00
ljkx 09cb86b076 feat(relinker): lower CLZERO for --to-intel
Lower CLZERO out of line instead of failing the relink: the 64-byte line
containing rAX (EAX with 67h) is cleared with four MOVNTDQ stores of
zero, the same non-temporal, weakly ordered store. The line address is
masked in xmm0 so RFLAGS stays untouched; xmm0 and rcx are spilled below
the red zone. Short sites share stubs through MatchSequence. CLZERO with
LOCK, an FS/GS override, a 66/F2/F3 prefix or longer than 15 bytes fails
the relink.

The decoder splits a REX followed by another prefix into a separate
instruction, which would hide a prefix that changes what CLZERO or the
next instruction does. The converter now fails the relink when such a
prefix-only fragment directly precedes an AMD-only instruction or would
be moved into a stub as a trailing instruction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 12:30:35 +02:00
boykopovar 98b175f938 refactor(agc): fix deps after splitting 2026-10-01 13:24:48 +03:00
SamG-Coder 7bcde3ba95 fix(tools): count tested shared shader instruction variants 2026-10-01 20:23:58 +10:00
SamG-Coder f5e1fcfad3 fix(agc): bind native depth textures for comparison sampling 2026-10-01 20:23:58 +10:00
SamG-Coder ba22c37d17 fix(shader): preserve constant offsets in image sampling 2026-10-01 20:23:21 +10:00
SamG-Coder 70cb9e2eaf feat(shader): translate signed and unsigned 24-bit high products 2026-10-01 20:23:21 +10:00
SamG-Coder 1571ec6914 feat(shader): lower bounded PC-relative jump tables 2026-10-01 20:19:03 +10:00
boykopovar 719b9328b3 refactor(agc): split driver into logical modules 2026-10-01 13:18:40 +03:00
SamG-Coder c329ad26b7 fix(shader): preserve upstream parameter validation during interpolation 2026-10-01 20:15:52 +10:00
SamG-Coder a8311e9d1a fix(shader): preserve interpolation instruction operands 2026-10-01 20:11:53 +10:00
boykopovar c7fb2575a3
Merge pull request #208 from boykopovar/refactor/split-libs-tests-cmake
Refactor/split libs tests cmake
- Moved test inclusions from `core/libs/CMakeLists.txt` to local library CMakeLists.txt files.
- Created CMakeLists.txt files for `libSceSystemService, libSceContentExport, libSceNet, libSceNetCtl, libSceRandom, libSceRtc, libSceJson2, and libSceFiber`.
- The shared libSceNet/libSceNetCtl test is included in libSceNet.
- Added the shared function add_test_executable for hosting test executables.
- Added add_png_decoder(target runtimeTarget) and add_jpeg_decoder(target runtimeTarget). The runtimeTarget parameter is required; libc is currently passed. A non-existent target causes a CMake error. - The decoder is used by the PRX libraries, meaning exceptions from there should be thrown through our libc.prx.

Changed file locations relative to the build folder (previously they were stored in core/libs):
- tests/ - all test executables
- `core/libs/libs/implib/` - PRX import libraries (*.dll.a)

The number of tests found has not changed (88)
2026-10-01 12:55:05 +03:00
boykopovar f694c1387c
Merge pull request #201 from ljkx/feat/monitorx-mwaitx-to-intel
feat(relinker): lower MONITORX and MWAITX for --to-intel
2026-10-01 12:50:04 +03:00
boykopovar bbba29ea61 refactor(cmake): add local library configs and move test definitions 2026-10-01 12:44:01 +03:00
boykopovar a32715f71f refactor(cmake): require explicit runtime target for png and jpeg decoders 2026-10-01 12:38:06 +03:00
boykopovar 867167e2ff refactor(cmake): move prx.a import libraries to implib directory 2026-10-01 12:32:22 +03:00
boykopovar 61ba4d661a refactor(cmake): place all test executables in build tests directory 2026-10-01 12:28:06 +03:00
boykopovar b22ede6c93 refactor(cmake): move some libs test definitions to local cmakelists 2026-10-01 12:21:46 +03:00
boykopovar 96c55bba3f
Merge pull request #98 from SamG-Coder/codex/videoout-vblank-timing
fix(runtime): run converted SDK samples through clean C++ shutdown
2026-10-01 12:08:10 +03:00
SamG-Coder a6ea90b919 fix(libc): reject unsupported format extensions explicitly 2026-10-01 12:00:50 +03:00
SamG-Coder 4e2b200a91 fix(libc): invoke guest exit callbacks with the SysV ABI 2026-10-01 12:00:49 +03:00
SamG-Coder d9d34a47ac fix(libc): translate guest scanning and wide formatting arguments 2026-10-01 12:00:41 +03:00
SamG-Coder 3a651055bb feat(libc): support C locale wide stream input 2026-10-01 11:59:11 +03:00
SamG-Coder 7f834fc415 feat(libc): add C locale conversion and sample runtime exports 2026-10-01 11:58:51 +03:00
SamG-Coder ad6b37ed42 fix(relinker): resolve guest dependencies and lifecycle arrays 2026-10-01 11:57:13 +03:00
SamG-Coder 3c5fe188b7 fix(relinker): forward Windows arguments to guest startup 2026-10-01 11:57:13 +03:00
boykopovar 8cc16ec23a
Merge pull request #184 from YossiYad/fix/self-input-diagnostic
fix(relinker): name the SELF container and the bytes read when the input is not an ELF
2026-10-01 11:53:18 +03:00
Yossi Yadgar 058ba1e08d fix(relinker): name the SELF container and the bytes read when the input is not an ELF 2026-10-01 11:47:55 +03:00
boykopovar e57ee5120d
Merge pull request #206 from Praetorian0420/main
Implement network control and socket functionality improvements
2026-10-01 11:41:41 +03:00
ljkx f994b4f89f feat(relinker): lower MONITORX and MWAITX for --to-intel
Replace MONITORX with a NOP and MWAITX with PAUSE in place, padded with
NOPs to the original length, instead of failing the relink. MWAITX may
return before its timer or a store to the monitored line, and without an
armed monitor it does not wait, so callers already re-check their
condition; the replacement takes that path every time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 10:35:23 +02:00
boykopovar 63071deb03
Merge pull request #205 from oneandonlydean/fix/recompiler-fma-mix-op-sel
fix(recompiler): select v_fma_mix source precision by OP_SEL_HI and the half by OP_SEL
2026-10-01 11:32:45 +03:00
boykopovar db5ce0f83c
Merge pull request #204 from oneandonlydean/fix/agc-misaligned-buffers-in-shader-data
fix(agc): patch the memory offsets of misaligned guest buffers in the shader data buffer
2026-10-01 11:31:57 +03:00
boykopovar 33e11c7ea2
Merge pull request #203 from oneandonlydean/fix/libkernel-direct-memory-memfd
fix(libkernel): back direct memory with a memfd on Linux
2026-10-01 11:31:43 +03:00
boykopovar 4a73353eda
Merge pull request #202 from oneandonlydean/fix/agc-misaligned-draw-snapshots
fix(agc): snapshot misaligned draw inputs from the offset the shader reads
2026-10-01 11:31:30 +03:00
boykopovar 261272909c
Merge pull request #200 from ljkx/feat/sha256-to-intel
feat(relinker): lower SHA-256 instructions for --to-intel
2026-10-01 11:31:02 +03:00
boykopovar 4c1a92fe32
Merge pull request #199 from MichonGoddijn231849/fix/command-buffer-reserve
fix(agc): grow a command buffer whose free space is below its reserved words
2026-10-01 11:30:39 +03:00
boykopovar 5ab2fb00ee
Merge pull request #132 from oneandonlydean/feat/agc-cb-eliminate-passes
feat(agc): run CB fast-clear eliminate and DCC decompress passes within the DCC model
2026-10-01 11:29:22 +03:00
boykopovar 9623054a12
Merge pull request #181 from oneandonlydean/fix/agc-sample-2d-over-array
fix(agc): sample a 2D instruction over a 2D array texture through its first layer
2026-10-01 11:28:42 +03:00
boykopovar e4eaba6b2e
Merge pull request #198 from MichonGoddijn231849/fix/reserve-virtual-fixed
fix(libkernel): honour MAP_FIXED in sceKernelReserveVirtualRange and sceKernelMemoryPoolReserve
2026-10-01 11:28:18 +03:00
boykopovar cfb1f590bd
Merge pull request #197 from MichonGoddijn231849/fix/alias-view-granularity
fix(libc): map a shared-memory alias from the allocation granularity below its offset
2026-10-01 11:27:28 +03:00
boykopovar a7fdb497fe
Merge pull request #195 from MichonGoddijn231849/fix/guest-module-tls
fix(relinker): give Windows guest modules with TLS an import directory
2026-10-01 11:15:39 +03:00
Dean Galvin aa9a5c02a7 feat(agc): run CB fast-clear eliminate and DCC decompress passes within the DCC model
Draws with CB_COLOR_CONTROL MODE ELIMINATE_FAST_CLEAR (2) or DCC_DECOMPRESS
(6) were rejected as "only normal color rendering with copy ROP". On
hardware these full-target blits write the fast-clear value into the
fast-cleared pixels (or store the pixels uncompressed); the shader's output
never lands. In this driver's DCC model (surfaces stored uncompressed,
uniform fast-clear keys make every read return the clear value) that is:

- keys that are a clear code: the target's texels become that value and
  its keys read uncompressed. Reads see the same values before and after.
- uncompressed keys, or a target without DCC: nothing changes.
- mixed keys (per-block metadata), a mipmapped DCC target (its keys are not
  decoded) or a register clear of a texel over 64 bits: throw.

The texels go into the target's resident image (its refresh already
cleared it to a code's value; the register code is cleared on the GPU with
FillClear) and reach memory through its write-back, or into guest memory
on the CPU when there is no resident image. A resident image made under
other DCC keys is remade under the target's keys by the storage cache
before the pass reads it. DecodeColorMetadataPass
requires the draw to be only that pass: copy ROP, no depth or stencil
work, no multisampling, a viewport and scissor covering each target.
Indirect passes throw. The CB_COLOR decode moves into DecodeColorBuffer,
which also reads CB_COLOR_CLEAR_WORD0/1.

The register clear code (DCC key 0x20) had no value before: its keys were
read as the stored texels. A target under register keys now reads as its
CB_COLOR_CLEAR_WORD texel: a resident target is cleared to it before a draw
renders into it (then its keys read uncompressed), and a non-resident
target's copy starts from it.

Every decision that materializes a clear reads the keys through
CurrentDccKeys, which first waits for the batches up to the newest recorded
writer of the key range. The title's fast-clear fill of the metadata can
still be pending on the GPU when the next draw is decoded; reading the
stale bytes there made a later draw clear the target over the results of
the earlier ones.

The remaining CB modes (resolve, decompress, FMASK decompress) keep the
rejection, which now names the mode.
2026-10-01 20:59:03 +13:00
Dean Galvin 74abc7acc3 fix(agc): sample a 2D instruction over a 2D array texture through its first layer
A shader sampling with MIMG DIM 2D over a T# of type 2D array was
refused: "guest texture dimension disagrees with the shader's declared
image shape (shape 1, dimension 2)". The access carries no slice
coordinate, so the hardware samples slice 0 of the resource view, the
BASE_ARRAY layer, as it does for the storage access of the previous
commit.

A 2D array Texture now also makes a 2D view of that layer
(Texture::FirstLayerView), whether it holds its own snapshot or views the
surface's storage image, and the sampled binding uses it for such an
access. Every other shape/dimension mismatch still throws.
2026-10-01 20:57:49 +13:00
boykopovar aa74ed81b9
Merge pull request #193 from arreina/pr/elf-reader-overflow
fix(relinker): keep ELF bounds checks from overflowing
2026-10-01 10:53:23 +03:00