Commit Graph

911 Commits

Author SHA1 Message Date
boykopovar 00a18dc10f
Merge pull request #131 from oneandonlydean/fix/agc-2d-over-array-storage
fix(agc): bind a 2D storage access to a 2D array surface as its first layer
2026-10-01 10:40:20 +03:00
Dean Galvin edb1358117 fix(agc): bind a 2D storage access to a 2D array surface as its first layer
A compute shader addressing an image with MIMG DIM 2D over a T# of type 2D
array was refused ("guest storage texture dimension disagrees with the
shader's declared image shape"). Such an access carries no slice
coordinate, so the hardware reads and writes slice 0 of the resource view,
which is the BASE_ARRAY layer of the surface.

The storage element is now bound through a 2D view of that layer of the
surface's shared storage image (StorageTexture::FirstLayerView, created on
demand per mip and released with the image). Every other shape/dimension
mismatch still throws, and both mismatch messages now name the shape and
the dimension.

The recorder test device sets formatProperties, which storage images need
to pick their Vulkan format.
2026-10-01 10:23:36 +03:00
boykopovar 74f84dd048
Merge pull request #130 from oneandonlydean/feat/agc-texture-min-lod
feat(agc): apply a texture descriptor's MIN_LOD clamp through the image view
2026-10-01 10:17:19 +03:00
boykopovar 89afcdc070
Merge pull request #124 from oneandonlydean/feat/agc-fuse-shader-halves
fix(agc): fuse geometry shader halves into one self-contained program
2026-10-01 10:12:31 +03:00
Dean Galvin 258e4d526d fix(agc): fuse geometry shader halves into one self-contained program
sceAgcUnknownFuseShaderHalves (fd4700b9) fuses both kinds of halves at
the register level: the back half's registers with the front half's
program address in PGM_LO_ES (PGM_LO_LS for hull halves). For geometry
halves the driver then compiles that front half as the draw's whole
program (type 4, Stage::Mesh) and skips the back (Role::GeometryBack);
nothing links the two. The front ends in s_setpc_b64 s[6:7] and has no
s_endpgm, so the decode runs on into the s_code_end padding and the
program trailer. In PPSA21564 the geometry shader draws were skipped
with "unsupported SOPP opcode 31" (s_code_end) and "unsupported scalar
source operand code 115 at program counter 64".

Geometry halves are now fused into one Gs program: the front half's code
up to its final s_setpc_b64 s[6:7] (its length comes from the program
trailer), s_nop padding to the next 256 bytes, then the whole back half,
so the front falls through into the back. Its SH registers are the back
half's, with PGM_LO/HI_GS pointing at the copied back code, the ES
program address at the fused code, RSRC1 taking the larger VGPR and SGPR
counts of the two halves, RSRC2 taking the front half's user-SGPR count
(the SPI loads the front layout; the back reloads its own from memory
through s[0:1]), and the front's other SH registers except its checksum
appended. Context registers are merged the same way. Inputs come from
the front, outputs, specials and user data from the back; the scratch
size is the larger of the two.

Everything the fused Shader points to, including a copy of the header
itself, is written into the caller's memory after the code, and the
header is registered with the driver as a self-contained shader. Titles
pass memory without honouring the reported alignment, so the program is
placed at the first 256-byte boundary inside it, and the size query
returns the total plus 255 bytes of padding (alignment reported as log2
8). Halves with embedded constant buffers, a front half without a
trailer or final s_setpc_b64, a front half that needs RSRC2 state the
back half does not enable, and geometry halves without fused memory
throw.

Hull halves keep the register-level fusion, which the tessellation
path's separate local and hull programs fit. The half-type and stage
checks stay shared.

The driver now loads s[0:1] of a Gs program from its user-data address
registers whenever they are set, not only for GsFront programs, since
the back half of a fused program reloads its user data from there; a
program without those registers keeps zero there (from SamG-Coder's
8345fbc1).
2026-10-01 08:45:51 +13:00
Dean Galvin 2be78b6965 feat(agc): apply a texture descriptor's MIN_LOD clamp through the image view
T# word1 MIN_LOD (unsigned 4.8, in levels of the whole surface) was
rejected. Sampled views now chain VkImageViewMinLodCreateInfoEXT
(VK_EXT_image_view_min_lod, enabled when the device offers the minLod
feature). Its minLod counts levels of the whole image exactly as MIN_LOD
counts levels of the whole surface, because the image holds every mip and
the view starts at BASE_LEVEL.

- A clamp at or below BASE_LEVEL cannot change which level a sample reads
  and is left off; one past the view's last level is bounded by it (the
  view selects that level anyway, and Vulkan requires the bound).
- A clamp that binds on a device without the feature throws.
- The texture cache already keys by the eight descriptor words, so views
  with different clamps are not shared.
- Storage views address one level: a clamp at or below that level is
  accepted, one above it still throws.
2026-10-01 08:30:05 +13:00
boykopovar a67b644ff6
Merge pull request #192 from MichonGoddijn231849/perf/validation-failure-memo
perf(agc): remember shader validation failures and reject repeats without throwing
2026-09-30 22:12:58 +03:00
boykopovar c71be475fc
Merge pull request #187 from MichonGoddijn231849/feat/demons-souls-exports
feat: export the AMPR command buffer waits and writes, sceAgcFuseShaderHalves, sceAgcSetSubmitMode, sceNpSessionSignalingCreateContext and sceNetEpollAbort
2026-09-30 22:03:54 +03:00
boykopovar f59c867a5b
Merge pull request #183 from arreina/fix/elf-header-size
fix(relinker): require a full ELF64 header before reading it
2026-09-30 22:03:27 +03:00
boykopovar a54cffadc3
Merge pull request #190 from RomainROCH/fix/buffer-offset-overflow
fix(relinker): reject overflowing buffer offsets
2026-09-30 22:00:51 +03:00
boykopovar 7b767489f3
Merge pull request #172 from STL1te/fix/savedata-params
fix(savedata): the native module keeps save directory params and moun…
2026-09-30 21:46:55 +03:00
boykopovar 78a34f8e82
Merge pull request #180 from oneandonlydean/feat/audioout2-dualsense-ports
feat(audio): play the DualSense speaker and vibration ports on its USB sound card
2026-09-30 21:35:16 +03:00
boykopovar d2d221a123
Merge pull request #179 from oneandonlydean/fix/pad-sdl-hidapi
fix(pad): build SDL with HIDAPI so DualSense output reaches the controller
2026-09-30 21:18:57 +03:00
boykopovar ced561723a
Merge pull request #177 from oneandonlydean/fix/agc-storage-image-moved-dcc-keys
fix(agc): remake a surface's storage image when its DCC keys move
2026-09-30 21:18:00 +03:00
STL1te a812d6314a fix(savedata): throw on a param file that cannot be read or has the wrong size
A .param file of a save directory or of save data memory that exists but cannot
be read, or whose size is not sizeof(SaveDataParam), was silently ignored or
truncated. It now throws, naming the file and, for a size mismatch, both sizes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 21:14:20 +03:00
boykopovar 52ab9e3544
Merge pull request #176 from oneandonlydean/fix/agc-indexed-draw-index-offset
fix(agc): apply GE_INDX_OFFSET as the base vertex of direct indexed draws
2026-09-30 21:13:57 +03:00
boykopovar d7ab5e371e
Merge pull request #175 from Qznad/feat/decoder-png
feat(pngdec): implement the PNG decoder
2026-09-30 21:12:56 +03:00
boykopovar bbb15959eb
Merge pull request #174 from STL1te/fix/bda-lookup-dontinline
fix(shader): BDA lookup functions are not inlined
2026-09-30 21:12:05 +03:00
boykopovar f583d2638c
Merge pull request #165 from MichonGoddijn231849/perf/skip-report-single-write
perf(agc): write each skip report in one call and cap its request dumps
2026-09-30 21:05:39 +03:00
boykopovar 95f34bed3d
Merge pull request #171 from asimplestray/feat/kernel-time-signal
feat(kernel): implement Sleep, sigprocmask and pthread finalize
2026-09-30 21:03:48 +03:00
boykopovar c3aed31639
Merge pull request #169 from asimplestray/feat/kernel-file-ops
feat(kernel): implement file metadata ops and address conversion
2026-09-30 21:03:08 +03:00
boykopovar ba1d32f450
Merge pull request #168 from asimplestray/feat/kernel-psem
feat(kernel): implement pthread semaphore lifecycle
2026-09-30 21:01:53 +03:00
boykopovar 6756edb91f
Merge pull request #164 from MichonGoddijn231849/fix/munmap-across-mappings
fix(libkernel): unmap ranges that span several mappings
2026-09-30 20:55:43 +03:00
boykopovar c227fe4104
Merge pull request #162 from MichonGoddijn231849/fix/f16-inline-constants
fix(recompiler): read f16 inline constants as half values and honour VOP3 f16 op_sel
2026-09-30 20:42:23 +03:00
boykopovar f66789ada2
Merge pull request #186 from MichonGoddijn231849/fix/host-import-shared-alias
fix(agc): import shared guest memory through a read-write alias and never offer read-only pages
2026-09-30 20:41:23 +03:00
boykopovar fe712e7b9e
Merge pull request #101 from asimplestray/feat/rt-miss-config
feat(shader): configurable ray tracing miss fallback
2026-09-30 20:40:33 +03:00
boykopovar 488e678aa8
Merge pull request #161 from asimplestray/feat/libc-lifecycle
feat(libc): implement cxa lifecycle aliases and init_env
2026-09-30 20:35:36 +03:00
boykopovar 9444753275
Merge pull request #188 from MichonGoddijn231849/fix/d16-depth-integer-reads
fix(agc): read a 16-bit integer view of a depth plane as its stored values
2026-09-30 20:24:56 +03:00
Michon f4be8f435d fix(agc): throw when guest memory can be neither imported, aliased nor copied exactly
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-30 19:14:22 +02:00
asimplestray 976fa82054 feat(shader): configurable ray tracing miss fallback 2026-09-30 16:53:03 +00:00
asimplestray a4e755ccb1 feat(kernel): implement file metadata ops and address conversion 2026-09-30 16:51:37 +00:00
Alberto Ruiz a4b131435a fix(relinker): require a full ELF64 header before reading it
ReadHeader reads fields up to offset 0x40 but only rejected files
shorter than 20 bytes, so a truncated ELF failed with
"FileByteOffset out of bounds" instead of "File too small for ELF header".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R5WJS4ZdQynAJesCZKH5hb
2026-09-30 18:47:32 +02:00
Michon 98d48ec8d2 perf(agc): remember shader validation failures and reject repeats without throwing
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-30 18:43:55 +02:00
boykopovar f881e021a8
Merge pull request #160 from asimplestray/feat/libc-wide-io
feat(libc): implement fputwc, fputws and fscanf
2026-09-30 19:40:31 +03:00
RomainROCH 442ffbb936 chore: sync upstream main for CI 2026-09-30 18:37:59 +02:00
boykopovar 60bd808132
Merge pull request #185 from ljkx/feat/insertq-register-form
feat(relinker): lower register-form INSERTQ
2026-09-30 19:37:18 +03:00
boykopovar ec0c39bf6c
Merge pull request #158 from carman24r/main
feat(agc): implement register commands and count patching
2026-09-30 19:33:52 +03:00
boykopovar e33abc1ad6
Merge pull request #155 from Pacuka/fix/sysmodule-unload-unknown
fix(sysmodule): unload unknown module ids as no-ops
2026-09-30 19:26:54 +03:00
boykopovar 4bfd97cdef
Merge pull request #154 from Pacuka/fix/userservice-invalid-argument
fix(userservice): report invalid arguments as 0x80960005
2026-09-30 19:25:46 +03:00
boykopovar c09b8759b2
Merge pull request #152 from Digote/feat/shader-s-bitcmp-b64
feat(shader): support 64-bit scalar bit compare
2026-09-30 19:25:12 +03:00
boykopovar a6c7eca552
Merge pull request #151 from MartinCajiao/feat/guest-intel-trampolines
feat(relinker): support Intel trampolines in guest modules
2026-09-30 19:24:46 +03:00
Michon 2b5f2d32d3 feat: export the AMPR command buffer waits and writes, sceAgcFuseShaderHalves, sceAgcSetSubmitMode, sceNpSessionSignalingCreateContext and sceNetEpollAbort
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-30 18:19:55 +02:00
boykopovar d2754f6f56
Merge pull request #189 from adriadam10/ci/label-colors
ci: give labels colors and descriptions
2026-09-30 19:16:28 +03:00
boykopovar 407a1f4a66
ci(labels): set colors only for some 2026-09-30 19:15:51 +03:00
boykopovar 1dfdd708e9
Merge pull request #149 from adriadam10/ci/pr-overlap
ci: comment on pull requests that overlap other open pull requests
2026-09-30 19:12:31 +03:00
RomainROCH b6ff4a2116 fix(relinker): reject overflowing buffer offsets 2026-09-30 18:07:26 +02:00
Adrià Franch b17c536fbd ci: give labels colors and descriptions
Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-30 18:07:17 +02:00
boykopovar fc7f1e7fd1
Merge pull request #140 from SamG-Coder/codex/windows-startup-unwind
fix(relinker): align Windows startup unwind metadata
2026-09-30 18:59:23 +03:00
boykopovar a56313375f
Merge pull request #138 from oneandonlydean/feat/agc-eop-interrupts
feat(agc): register driver eq events and deliver end-of-pipe interrupts
2026-09-30 18:56:52 +03:00
boykopovar 1c1d8fb9df
Merge pull request #135 from oneandonlydean/fix/agc-drop-exports-past-attachments
fix(agc): drop pixel shader exports past the draw's attachments
2026-09-30 18:55:39 +03:00