fix(agc): update snapshot header and bytes on relocated header ABI resolution #2969
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2969"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by NRAPM on 2026-10-10T18:59:53Z.
Fixes #2914.
What
In titles such as Astro's Playroom (PPSA01325), shader ABI resolution calls (
ResolveGraphicsStagesAbi,ResolveShaderAbi,ResolveGraphicsAbi) can pass aShader*whose code pointer matches a registered shader, but whose header is allocated or copied at a different guest address.When
SameHeadervalidates the relocated header,snapshot.headerAddressandsnapshot.headerwere not updated to the new copy. Because the header contains absolute guest pointers (such asshader.user_data, input semantics) that are relative to the header address, downstream decoders (DecodeVertexStageInfo/_readHeaderPod) compute offsets against the mismatched base address and throwAGC graphics: AGC header pointer is outside the registered shader header.This change:
ShaderSnapshot::headerAddressandShaderSnapshot::headeras mutable.headerAddressand re-reads the header bytes viaGuestMemory::CheckRangeandmemcpywhen the resolved shader pointer differs from the registered snapshot address, synchronized undermutex.PreparedShaders.cpptests with a relocated full header copy.TechnicalDebt.mdaccordingly.Tested
python tools/check_conventions.py --base origin/main(passed).python -m unittest discover tools/tests(52/52 passed).git diff --check(clean).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T19:05:26Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)docs/dev/TechnicalDebt.mdL280docs/dev/TechnicalDebt.mdL280docs/dev/TechnicalDebt.mdL280core/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cppL209, L684-686, L750-751, L812-813Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T19:10:26Z.
Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T04:36:07Z.
This couldn't be reopened: the branch was force-pushed after the close. The new head (
dbdecd93) also doesn't build.UpdateSnapshotHeaderis inserted before the closing brace ofRegisteredProgram, so it ends up inside it.Besides the brace: the description says the update is synchronized under
mutex, but nothing locks it. Makingheader/headerAddressmutableand rewriting them in place changes a sharedconstsnapshot that other threads may be reading. Could you publish a new snapshot for the relocated header (or take the registry lock), build it, and add a test that fails onmain? Then I'll open it from your branch.Imported from boykopovar/AnyPS5. Originally posted by NRAPM on 2026-10-11T11:55:50Z.
Fixed the missing closing brace on
RegisteredProgramin00c6c0b5— thanks for catching that! Since GitHub prevents reopening after a force-push, feel free to cherry-pick / carry00c6c0b5directly, or let me know if you prefer a new PR from a fresh branch.Imported from boykopovar/AnyPS5. Originally posted by NRAPM on 2026-10-11T18:52:49Z.
Updated in
7fb5b337:mutablefromShaderSnapshotso snapshots remain strictly immutable.RelocateSnapshotHeaderpublishes a new snapshot for the relocated header viaPublishRegisteredShaderundermutexat the three resolve sites (ResolveGraphicsStagesAbi,ResolveShaderAbi,ResolveGraphicsAbi).PreparedShaders.cppfor relocated header copies.tools/check_conventions.py --base origin/mainandunittest discover tools/tests.Ready whenever you want to open it from
NRAPM:fix/agc-shader-abi-relocated-header.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T21:16:34Z.
Intake is open again, so please open a new PR from
NRAPM:fix/agc-shader-abi-relocated-header; a closed PR whose branch has moved can't be reopened.Imported from boykopovar/AnyPS5. Originally posted by NRAPM on 2026-10-11T22:02:14Z.
Opened #4043 from
NRAPM:fix/agc-shader-abi-relocated-header.Pull request closed