Commit Graph

600 Commits

Author SHA1 Message Date
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
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 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 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 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
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
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
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 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
boykopovar 14b883dbbb
Merge pull request #133 from oneandonlydean/feat/shader-ngg-mesh
feat(shader): translate NGG geometry programs to mesh shaders
2026-09-30 18:54:44 +03:00
boykopovar 7411f17cb7
Merge pull request #128 from oneandonlydean/feat/videoout-open-param
feat(videoout): accept a zeroed open param
2026-09-30 18:54:15 +03:00
Michon bbf430e22d fix(agc): read a 16-bit integer view of a depth plane as its stored values
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-30 17:54:01 +02:00
boykopovar 6b731a9ee2 fix(agc): update graphics test to use pixel export mappings 2026-09-30 18:42:16 +03:00
Dean Galvin 48687eefab fix(contentexport): refuse init parameters without allocators or with reserved fields set
sceContentExportInit2 accepted any non-null parameter block. It now throws
when the malloc or free function is missing or a reserved field is not
zero. A test covers these refusals and the init and term order.
2026-09-30 18:35:36 +03:00
Michon 8b8b710b07 fix(agc): import shared guest memory through a read-write alias and never offer read-only pages
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-30 17:17:17 +02:00
boykopovar 119a74952a
Merge pull request #126 from oneandonlydean/feat/systemservice-hdr-tone-map
feat(systemservice): report the SDR tone-map luminance
2026-09-30 18:12:00 +03:00
boykopovar 077d4a487f
Merge pull request #125 from oneandonlydean/feat/pthread-prio-inherit
feat(libkernel): accept priority-inheritance mutexes
2026-09-30 18:11:38 +03:00
boykopovar c02a614b06
Merge pull request #123 from oneandonlydean/fix/flaky-shader-memory-coverage
test(agc): accept a bindless table entry captured across a page boundary
2026-09-30 18:11:17 +03:00
boykopovar f952bbeeb7
Merge pull request #121 from oneandonlydean/feat/linux-guest-write-watch
feat(agc): track guest memory writes on Linux with async userfaultfd write protection
2026-09-30 18:10:48 +03:00
boykopovar 03fa5a146e
Merge pull request #120 from oneandonlydean/fix/agc-untracked-target-results
fix(agc): keep render target results where the write tracker cannot prove memory fresh
2026-09-30 18:09:58 +03:00
boykopovar 3b1fc95ff4
Merge pull request #119 from oneandonlydean/feat/packed-vertex-formats
feat(agc): decode the packed 2_10_10_10 and 10_11_11 float vertex buffer formats
2026-09-30 18:06:04 +03:00
boykopovar d1bf55ca14
Merge pull request #118 from oneandonlydean/feat/dispatch-tunnel-hint
feat(agc): accept the dispatch tunnel hint
2026-09-30 18:05:45 +03:00
boykopovar 837a222b54
Merge pull request #117 from oneandonlydean/feat/cdbg-branches
feat(recompiler): conditional debug branches translate as never taken
2026-09-30 18:04:55 +03:00
boykopovar eaa47d66ed
Merge pull request #114 from oneandonlydean/fix/inert-depth-write
fix(agc): accept depth writes that the disabled depth test makes inert
2026-09-30 17:56:37 +03:00
boykopovar 6bceb47ba4
Merge pull request #113 from oneandonlydean/test/agc-graphics-tests-link
test(agc): link agc_driver_graphics_tests again, run it under ctest and bring its stale expectations up to date
2026-09-30 17:55:46 +03:00
boykopovar 1e1f0562c6 refactor(videodec2): use shared ffmpeg-core submodule + remove black fallbacks 2026-09-30 17:41:49 +03:00