Add PS5 Pro mode (--ps5-pro) with PSSR request handling #1553

Closed
github-bot wants to merge 2 commits from gh-pr/1553/head into gh-pr/1553/base
Owner

@⁠loyalburrito on GitHub · 2026-10-16 10:05 UTC · original
loyalburrito:ps5-pro-mode → main · +329 −10 · 16 files · 2 commits · closed without merging

PS5 Pro mode (--ps5-pro) with PSSR request handling
Summary
Two commits: a shader-recompiler crash fix ASTRO BOT needs on current main, then the Pro mode.

Adds an opt-in PS5 Pro mode. With --ps5-pro, sceKernelIsTrinityMode and sceAgcGetIsTrinityMode report a PS5 Pro, so Pro-enhanced games take their Pro path. Their PSSR upscaling calls (libScePsml) are now handled instead of being dropped. For now the upscale is a linear scale of the game's colour image into the PSSR output; the request also carries the motion vectors, depth and camera data a temporal upscaler would need, so one can be added later.

Default behaviour is unchanged: without the option the emulator still reports a base PS5.

Changes
Option: --ps5-pro (Config::Ps5ProEnabled()), off by default.
What the game is told: KernelIsTrinityMode and AgcGetIsTrinityMode return the option. Kyty's own packet encoding (is_trinity_mode() in agc.cpp) stays in base mode on purpose.
libScePsml fixes:
PsmlSharedResourcesInitialize wrote 48 bytes into a 16-byte object, overwriting the game's globals that follow it (seen in ASTRO BOT). Only the magic and block list are written now.
PsmlContextInitialize wrote at +0x360/+0x368 of the context. The game uses the first qword of its context object as the handle it passes back to the other Psml calls, so the context now gets a pointer to a small record that starts with the context magic.
PSSR request in GPU order: PsmlDispatch receives {command buffer cursor, reserved dwords} and the request. Instead of the native library's GPU work it writes one IT_NOP packet with a new custom opcode R_PSSR carrying a copy of the request and its 7 image descriptors (graphics/guest_gpu/pssr.h). The command processor hands it to RenderExecutor::ProcessPssr when the GPU reaches it.
Upscale: renderPssr.cpp identifies the slots by size and format (largest = output; at the render size, 2 channels = motion vectors, 1 = depth, rest = colour) and blits colour into the output with a linear filter. The first requests are logged with their slot layout.
Testing
Windows 11, RTX 3080, ASTRO BOT (PPSA21567, 01.019.000):

--ps5-pro: the game takes its Pro path (sceKernelIsTrinityMode returns 1) and issues PSSR requests through PsmlDispatch (1536 reserved dwords, all 7 slots set). Slots seen: 0 output 3840x2160 B10G11R11, 1 colour 1920x1080 RGBA16F, 2 motion vectors 1920x1080, 3 depth R32F, 4 previous depth R32F, 5 exposure 1x1, 6 reactive R8. The intro and the warp scene render correctly through the linear path.
Without --ps5-pro: unchanged (base mode reported, no PSSR calls).
Needs the separate SRT null-pointer fix (first commit): without it ASTRO BOT crashes while preparing a compute shader on current main, with or without --ps5-pro.
Known limitations
Linear scaling only: the game jitters its camera for PSSR, so without a temporal upscaler the image is softer and shimmers; Pro mode may look worse than base mode until one is added.
The request layout was mapped from ASTRO BOT only; other Pro titles are untested.

**@⁠loyalburrito** on GitHub · 2026-10-16 10:05 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1553) `loyalburrito:ps5-pro-mode` → `main` · +329 −10 · 16 files · 2 commits · closed without merging PS5 Pro mode (--ps5-pro) with PSSR request handling Summary Two commits: a shader-recompiler crash fix ASTRO BOT needs on current main, then the Pro mode. Adds an opt-in PS5 Pro mode. With --ps5-pro, sceKernelIsTrinityMode and sceAgcGetIsTrinityMode report a PS5 Pro, so Pro-enhanced games take their Pro path. Their PSSR upscaling calls (libScePsml) are now handled instead of being dropped. For now the upscale is a linear scale of the game's colour image into the PSSR output; the request also carries the motion vectors, depth and camera data a temporal upscaler would need, so one can be added later. Default behaviour is unchanged: without the option the emulator still reports a base PS5. Changes Option: --ps5-pro (Config::Ps5ProEnabled()), off by default. What the game is told: KernelIsTrinityMode and AgcGetIsTrinityMode return the option. Kyty's own packet encoding (is_trinity_mode() in agc.cpp) stays in base mode on purpose. libScePsml fixes: PsmlSharedResourcesInitialize wrote 48 bytes into a 16-byte object, overwriting the game's globals that follow it (seen in ASTRO BOT). Only the magic and block list are written now. PsmlContextInitialize wrote at +0x360/+0x368 of the context. The game uses the first qword of its context object as the handle it passes back to the other Psml calls, so the context now gets a pointer to a small record that starts with the context magic. PSSR request in GPU order: PsmlDispatch receives {command buffer cursor, reserved dwords} and the request. Instead of the native library's GPU work it writes one IT_NOP packet with a new custom opcode R_PSSR carrying a copy of the request and its 7 image descriptors (graphics/guest_gpu/pssr.h). The command processor hands it to RenderExecutor::ProcessPssr when the GPU reaches it. Upscale: renderPssr.cpp identifies the slots by size and format (largest = output; at the render size, 2 channels = motion vectors, 1 = depth, rest = colour) and blits colour into the output with a linear filter. The first requests are logged with their slot layout. Testing Windows 11, RTX 3080, ASTRO BOT (PPSA21567, 01.019.000): --ps5-pro: the game takes its Pro path (sceKernelIsTrinityMode returns 1) and issues PSSR requests through PsmlDispatch (1536 reserved dwords, all 7 slots set). Slots seen: 0 output 3840x2160 B10G11R11, 1 colour 1920x1080 RGBA16F, 2 motion vectors 1920x1080, 3 depth R32F, 4 previous depth R32F, 5 exposure 1x1, 6 reactive R8. The intro and the warp scene render correctly through the linear path. Without --ps5-pro: unchanged (base mode reported, no PSSR calls). Needs the separate SRT null-pointer fix (first commit): without it ASTRO BOT crashes while preparing a compute shader on current main, with or without --ps5-pro. Known limitations Linear scaling only: the game jitters its camera for PSSR, so without a temporal upscaler the image is softer and shimmers; Pro mode may look worse than base mode until one is added. The request layout was mapped from ASTRO BOT only; other Pro titles are untested.
A resource table can hold a null pointer for an unused resource. Walking
it read guest memory at a small address (0x18 in ASTRO BOT) and crashed
the emulator while preparing a compute shader. Addresses below 64 KB can
never be guest memory, so they now read as zeros, which decode as a null
descriptor.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With --ps5-pro, sceKernelIsTrinityMode and sceAgcGetIsTrinityMode report
a PS5 Pro so Pro-enhanced games take their Pro path. Kyty's own packet
encoding (is_trinity_mode) stays in base mode. Off by default.

libScePsml:
- PsmlSharedResourcesInitialize wrote 48 bytes into a 16-byte object and
  overwrote the game's globals after it; only the magic and the block
  list are written now.
- PsmlContextInitialize: the game passes the first qword of its context
  object to the other Psml calls, so it now points to a record that starts
  with the context magic.
- PsmlDispatch writes one IT_NOP/R_PSSR packet into the space the game
  reserved, carrying a copy of the request and its image descriptors
  (graphics/guest_gpu/pssr.h), so the request runs in GPU order.

RenderExecutor::ProcessPssr identifies the images by size and format and
scales the colour image into the PSSR output with a linear filter. The
request also carries motion vectors, depth and camera data for a future
temporal upscaler.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:59:32 +00:00
github-bot closed this pull request 2026-11-26 09:59:32 +00:00
Author
Owner

@⁠defektu on GitHub · 2026-10-16 15:28 UTC · original

!1553 (commit b6ea5f4ff3) essentially reimplements what #1528 already did.

**@⁠defektu** on GitHub · 2026-10-16 15:28 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1553#issuecomment-6218848403) https://git.gtahub.st/github/KytyPS5--KytyPS5/pulls/1553/commits/b6ea5f4ff30508453a3d7ecc0917426f7f1c9661 essentially reimplements what #1528 already did.
Author
Owner

@⁠Nmzik on GitHub · 2026-11-04 02:11 UTC · original

Credited

**@⁠Nmzik** on GitHub · 2026-11-04 02:11 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1553#issuecomment-6620653103) Credited

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.