feat: GTA V in game, Story Mode renders (follows #153) #167

Closed
MichonGoddijn231849 wants to merge 8 commits from upstream-pr/167 into main
MichonGoddijn231849 commented 2026-09-29 21:56:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-09-29T21:56:59Z.


What

This builds on @STL1te's #153 (and #144 before it), which does the heavy lifting. It boots GTA V with its own sce_module through the intro, the menus and into the Story Mode load, with depth/stencil and mip-chain targets, AJM MP3, direct memory and the console services. None of this would exist without that work; thank you.

This PR takes it from the Story Mode load into the world. The prologue renders and plays, with audio and UI:

GTA V in game

Tested on PPSA04264, the US version (01.005). Rebased onto current main: the draw-cache and out-of-memory changes are ported onto the split driver (Execution/src/Driver/**). The fixes that were split out and merged (#162–#165, #186, #188) are no longer part of this branch.

What was missing between the Story Mode load and a rendered frame:

  • Offline services the Story Mode load reaches: the NpUtility bandwidth test, the sign-in, web browser and player dialogs, NpAuth, entitlement consumption, reachability and account age report signed out; sceKernelMtypeprotect changes the protection; the APR ForEach resolvers. The only silent stub is the PS Store icon show/hide (UI), listed under TechnicalDebt.
  • GPU memory: the load stopped at 30% with VK_ERROR_OUT_OF_DEVICE_MEMORY. Now:
    • host imports use 64 MiB windows;
    • the budget follows the system memory heap;
    • an allocation that runs out of device memory evicts and runs once more.
  • Rendering:
    • color targets with gaps (the G-buffer MRTs);
    • DB_DEPTH_VIEW depth array slices;
    • bit-field extracts of the packed pixel ancillary VGPR as gl_SampleID and gl_Layer;
    • gl_Layer through the Geometry capability;
    • the 32-bit SPI_SHADER_Z_FORMATs with the depth and sample-mask export enables;
    • a null T#'s constant DST_SEL.
  • Draw cache: it keys on the user words the program reads, memoizes failures, and serves draws that differ only in user data (data-only hits).

Story Mode is an add-on entitlement. The game hashes each owned label (joaat) against three constants; GTAVSTORYMODE001 matches one of them. Listing it in anyps5-entitlements.ini (the #153 mechanism) enables "Resume Story".

Not done yet

  • About 3–4 fps in the world. Most of the rest is draws the validator rejects: every rejection throws, and each unwinding costs over 1 ms.
  • Exposure: the lit scene is still about 10× too bright (exposure sits at its darkest clamp). The white screen and the pulsing were the bloom feedback, fixed by #249.
  • Some surfaces show garbage textures.
  • #232: reads into write-tracked guest memory. Without it the Story Mode load stops with pread failed, errno=5.
  • #231: the guest arena at its fixed range. Without it launches often abort at start with shared mapping outside the guest arena.
  • #249: sampled reads after a DCC key fill. Without it the world goes white, then pulses.
  • #256: NGG passthrough rect lists and fans. Without it the draws into the HDR target are rejected on current main.
  • #261: rect lists with explicitly interpolated parameters (fragment-shader barycentrics, #142). Without it the world renders black on current main.

Tested

Windows 11 Pro, AMD Ryzen 5 7600 (6-core), NVIDIA GeForce RTX 5080 (driver 32.0.16.1074), 32 GB DDR5-5600, MinGW-w64 GCC 15.2.0.

  • GTA V PPSA04264 (01.005), Performance mode, relinked with its own sce_module (libc, libSceJobManager, libSceNpCppWebApi).
  • Main menu → Resume Story → the North Yankton prologue renders, at 3–4 fps, still overexposed (see Not done yet).
  • Rebased onto main at 75434ee4. Tested with this branch, #231, #232, #249, #256 and #261.
  • ctest: all tests pass.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR (the general fixes are split out; this one is the title bring-up on top of #153)
  • No comments in code except technical debt
  • Unimplemented paths throw; silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (the screenshot is hosted outside it)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none to build; GTA needs #231 and #232 to reach the world, and #249, #256 and #261 for a stable frame
  • AI-assisted: yes. Written with Claude (Anthropic) under my direction; I reviewed and tested it.

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4683088611 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/167). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-09-29T21:56:59Z. --- ### What This builds on @STL1te's #153 (and #144 before it), which does the heavy lifting. It boots GTA V with its own `sce_module` through the intro, the menus and into the Story Mode load, with depth/stencil and mip-chain targets, AJM MP3, direct memory and the console services. None of this would exist without that work; thank you. This PR takes it from the Story Mode load **into the world**. The prologue renders and plays, with audio and UI: ![GTA V in game](https://raw.githubusercontent.com/MichonGoddijn231849/AnyPS5-fork/pr-assets/gta-in-game.png) Tested on PPSA04264, the US version (01.005). Rebased onto current `main`: the draw-cache and out-of-memory changes are ported onto the split driver (`Execution/src/Driver/**`). The fixes that were split out and merged (#162–#165, #186, #188) are no longer part of this branch. What was missing between the Story Mode load and a rendered frame: - **Offline services** the Story Mode load reaches: the NpUtility bandwidth test, the sign-in, web browser and player dialogs, NpAuth, entitlement consumption, reachability and account age report signed out; `sceKernelMtypeprotect` changes the protection; the APR ForEach resolvers. The only silent stub is the PS Store icon show/hide (UI), listed under TechnicalDebt. - **GPU memory:** the load stopped at 30% with `VK_ERROR_OUT_OF_DEVICE_MEMORY`. Now: - host imports use 64 MiB windows; - the budget follows the system memory heap; - an allocation that runs out of device memory evicts and runs once more. - **Rendering:** - color targets with gaps (the G-buffer MRTs); - DB_DEPTH_VIEW depth array slices; - bit-field extracts of the packed pixel ancillary VGPR as `gl_SampleID` and `gl_Layer`; - `gl_Layer` through the Geometry capability; - the 32-bit SPI_SHADER_Z_FORMATs with the depth and sample-mask export enables; - a null T#'s constant DST_SEL. - **Draw cache:** it keys on the user words the program reads, memoizes failures, and serves draws that differ only in user data (data-only hits). Story Mode is an add-on entitlement. The game hashes each owned label (joaat) against three constants; `GTAVSTORYMODE001` matches one of them. Listing it in `anyps5-entitlements.ini` (the #153 mechanism) enables "Resume Story". #### Not done yet - About 3–4 fps in the world. Most of the rest is draws the validator rejects: every rejection throws, and each unwinding costs over 1 ms. - Exposure: the lit scene is still about 10× too bright (exposure sits at its darkest clamp). The white screen and the pulsing were the bloom feedback, fixed by #249. - Some surfaces show garbage textures. #### Related - #232: reads into write-tracked guest memory. Without it the Story Mode load stops with `pread failed, errno=5`. - #231: the guest arena at its fixed range. Without it launches often abort at start with `shared mapping outside the guest arena`. - #249: sampled reads after a DCC key fill. Without it the world goes white, then pulses. - #256: NGG passthrough rect lists and fans. Without it the draws into the HDR target are rejected on current `main`. - #261: rect lists with explicitly interpolated parameters (fragment-shader barycentrics, #142). Without it the world renders black on current `main`. ### Tested Windows 11 Pro, AMD Ryzen 5 7600 (6-core), NVIDIA GeForce RTX 5080 (driver 32.0.16.1074), 32 GB DDR5-5600, MinGW-w64 GCC 15.2.0. - GTA V PPSA04264 (01.005), Performance mode, relinked with its own `sce_module` (libc, libSceJobManager, libSceNpCppWebApi). - Main menu → Resume Story → the North Yankton prologue renders, at 3–4 fps, still overexposed (see Not done yet). - Rebased onto `main` at 75434ee4. Tested with this branch, #231, #232, #249, #256 and #261. - `ctest`: all tests pass. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [ ] One topic per PR; follow-ups go in a new PR (the general fixes are split out; this one is the title bring-up on top of #153) - [x] No comments in code except technical debt - [x] Unimplemented paths throw; silent stubs are listed in TechnicalDebt - [x] No notes, investigation `.md` files or images added to the repository (the screenshot is hosted outside it) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none to build; GTA needs #231 and #232 to reach the world, and #249, #256 and #261 for a stable frame - [x] AI-assisted: yes. Written with Claude (Anthropic) under my direction; I reviewed and tested it. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-09-30 19:57:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-09-30T19:57:56Z.


Progress report (75434ee → a2804a4)

📈 System libraries: 78.19% (+1.19%, +36 implemented functions)

✅ 36 implemented
Library Name
libSceMsgDialog.native sceMsgDialogGetResult
libSceMsgDialog.native sceMsgDialogOpen
libSceNpAuth sceNpAuthAbortRequest
libSceNpAuth sceNpAuthCreateAsyncRequest
libSceNpAuth sceNpAuthDeleteRequest
libSceNpAuth sceNpAuthGetAuthorizationCodeV3
libSceNpAuth sceNpAuthPollAsync
libSceNpCommerce sceNpCommerceHidePsStoreIcon
libSceNpCommerce sceNpCommerceShowPsStoreIcon
libSceNpEntitlementAccess sceNpEntitlementAccessAbortRequest
libSceNpEntitlementAccess sceNpEntitlementAccessDeleteRequest
libSceNpEntitlementAccess sceNpEntitlementAccessGenerateTransactionId
libSceNpEntitlementAccess sceNpEntitlementAccessPollConsumeEntitlement
libSceNpEntitlementAccess sceNpEntitlementAccessRequestConsumeUnifiedEntitlement
libSceNpManager sceNpCheckNpReachability
libSceNpManager sceNpGetAccountAge
libSceNpUtility sceNpBandwidthTestAbort
libSceNpUtility sceNpBandwidthTestGetStatus
libSceNpUtility sceNpBandwidthTestInitStartDownload
libSceNpUtility sceNpBandwidthTestInitStartUpload
libSceNpUtility sceNpBandwidthTestShutdown
libScePlayerSelectionDialog scePlayerSelectionDialogTerminate
libSceSigninDialog sceSigninDialogInitialize
libSceSigninDialog sceSigninDialogOpen
libSceSigninDialog sceSigninDialogTerminate
libSceSigninDialog sceSigninDialogUpdateStatus
libSceSystemService sceSystemServiceInitializePlayerDialogParam
libSceSystemService sceSystemServiceLaunchPlayerDialog
libSceWebBrowserDialog sceWebBrowserDialogClose
libSceWebBrowserDialog sceWebBrowserDialogGetResult
libSceWebBrowserDialog sceWebBrowserDialogOpen
libkernel sceKernelAprResolveFilepathsToIdsAndFileSizesForEach
libkernel sceKernelAprResolveFilepathsToIdsForEach
libkernel sceKernelAprResolveFilepathsWithPrefixToIdsAndFileSizesForEach
libkernel sceKernelAprResolveFilepathsWithPrefixToIdsForEach
libkernel sceKernelMtypeprotect
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5918630379 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/167#issuecomment-5918630379). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-09-30T19:57:56Z. --- <!-- progress-report --> ### Progress report (75434ee → a2804a4) 📈 **System libraries**: 78.19% (+1.19%, +36 implemented functions) <details> <summary>✅ 36 implemented</summary> | Library | Name | | - | - | | libSceMsgDialog.native | `sceMsgDialogGetResult` | | libSceMsgDialog.native | `sceMsgDialogOpen` | | libSceNpAuth | `sceNpAuthAbortRequest` | | libSceNpAuth | `sceNpAuthCreateAsyncRequest` | | libSceNpAuth | `sceNpAuthDeleteRequest` | | libSceNpAuth | `sceNpAuthGetAuthorizationCodeV3` | | libSceNpAuth | `sceNpAuthPollAsync` | | libSceNpCommerce | `sceNpCommerceHidePsStoreIcon` | | libSceNpCommerce | `sceNpCommerceShowPsStoreIcon` | | libSceNpEntitlementAccess | `sceNpEntitlementAccessAbortRequest` | | libSceNpEntitlementAccess | `sceNpEntitlementAccessDeleteRequest` | | libSceNpEntitlementAccess | `sceNpEntitlementAccessGenerateTransactionId` | | libSceNpEntitlementAccess | `sceNpEntitlementAccessPollConsumeEntitlement` | | libSceNpEntitlementAccess | `sceNpEntitlementAccessRequestConsumeUnifiedEntitlement` | | libSceNpManager | `sceNpCheckNpReachability` | | libSceNpManager | `sceNpGetAccountAge` | | libSceNpUtility | `sceNpBandwidthTestAbort` | | libSceNpUtility | `sceNpBandwidthTestGetStatus` | | libSceNpUtility | `sceNpBandwidthTestInitStartDownload` | | libSceNpUtility | `sceNpBandwidthTestInitStartUpload` | | libSceNpUtility | `sceNpBandwidthTestShutdown` | | libScePlayerSelectionDialog | `scePlayerSelectionDialogTerminate` | | libSceSigninDialog | `sceSigninDialogInitialize` | | libSceSigninDialog | `sceSigninDialogOpen` | | libSceSigninDialog | `sceSigninDialogTerminate` | | libSceSigninDialog | `sceSigninDialogUpdateStatus` | | libSceSystemService | `sceSystemServiceInitializePlayerDialogParam` | | libSceSystemService | `sceSystemServiceLaunchPlayerDialog` | | libSceWebBrowserDialog | `sceWebBrowserDialogClose` | | libSceWebBrowserDialog | `sceWebBrowserDialogGetResult` | | libSceWebBrowserDialog | `sceWebBrowserDialogOpen` | | libkernel | `sceKernelAprResolveFilepathsToIdsAndFileSizesForEach` | | libkernel | `sceKernelAprResolveFilepathsToIdsForEach` | | libkernel | `sceKernelAprResolveFilepathsWithPrefixToIdsAndFileSizesForEach` | | libkernel | `sceKernelAprResolveFilepathsWithPrefixToIdsForEach` | | libkernel | `sceKernelMtypeprotect` | </details>
boykopovar commented 2026-10-01 20:49:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by boykopovar on 2026-10-01T20:49:52Z.


I tried running it on Dreaming Sarah. After these changes, a strange bug appeared where the text menu buttons weren't visible until you clicked them. The rendering process also started flickering constantly.

The only suspicious message in the console: [gpu] host import budget 30699 MiB (system memory heap 32747 MiB; APS5_HOST_IMPORT_MIB overrides)

This wasn't a problem before. I think it's best to split this PR into several smaller ones that can be merged without causing regression.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5940276470 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/167#issuecomment-5940276470). Originally posted by [boykopovar](https://github.com/boykopovar) on 2026-10-01T20:49:52Z. --- I tried running it on Dreaming Sarah. After these changes, a strange bug appeared where the text menu buttons weren't visible until you clicked them. The rendering process also started flickering constantly. The only suspicious message in the console: `[gpu] host import budget 30699 MiB (system memory heap 32747 MiB; APS5_HOST_IMPORT_MIB overrides)` This wasn't a problem before. I think it's best to split this PR into several smaller ones that can be merged without causing regression.
MichonGoddijn231849 commented 2026-10-01 21:59:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-01T21:59:02Z.


Thanks for testing it on Dreaming Sarah. I reproduced the missing menu text and bisected it to the draw-cache commit. A new key of a shape replaced that shape's previous entry and took over its compiled variants. Those were compiled under the previous entry's user words, and a variant only validates the memory it captured, so each text draw drew with the previous one's data. The superseding entry now starts without those variants.

Split into independent PRs as you suggested. Each was checked on Dreaming Sarah's title menu (text shows) and with ctest:

  • #292 offline services (GTA V Story Mode)
  • #290 host import windows, least-recent eviction, recoverable GPU out-of-memory. The budget stays at main's 6 GiB, so the host import budget … (system memory heap …) line is gone.
  • #291 draw cache: user-word keys, failure memo, data-only hits, with the fix above (depends on #290)
  • #293 null sampled descriptors as 1×1 textures honouring DST_SEL
  • #294 color targets with MRT gaps, depth array slices
  • #295 packed pixel ancillary, gl_Layer via Geometry, Z export formats

GTA V also needs #231, #232, #249 and #261. Closing this one in favour of those.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5941495489 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/167#issuecomment-5941495489). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-01T21:59:02Z. --- Thanks for testing it on Dreaming Sarah. I reproduced the missing menu text and bisected it to the draw-cache commit. A new key of a shape replaced that shape's previous entry and took over its compiled variants. Those were compiled under the previous entry's user words, and a variant only validates the memory it captured, so each text draw drew with the previous one's data. The superseding entry now starts without those variants. Split into independent PRs as you suggested. Each was checked on Dreaming Sarah's title menu (text shows) and with ctest: - #292 offline services (GTA V Story Mode) - #290 host import windows, least-recent eviction, recoverable GPU out-of-memory. The budget stays at main's 6 GiB, so the `host import budget … (system memory heap …)` line is gone. - #291 draw cache: user-word keys, failure memo, data-only hits, with the fix above (depends on #290) - #293 null sampled descriptors as 1×1 textures honouring DST_SEL - #294 color targets with MRT gaps, depth array slices - #295 packed pixel ancillary, gl_Layer via Geometry, Z export formats GTA V also needs #231, #232, #249 and #261. Closing this one in favour of those.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!167
No description provided.