libs: implement 14 Agc GetSize entry points GTA V imports #2441
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!2441
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2441"
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?
@Moonwolf711 on GitHub · 2026-11-20 06:25 UTC · original
Moonwolf711:agc-getsize→main· +215 −0 · 3 files · 3 commits · openGTA V (PPSA04263/04264) imports a set of
sceAgc*functions that are not registered, so the runtime linker patches them to the unresolved-import stub returning 0. A game calling one of the*GetSizefunctions to reserve command-buffer space gets a zero-sized reservation while the corresponding builder writes a full packet.All NID/name pairs in this PR are hash-verified with the PS5 NID scheme (SHA-1 + 16-byte suffix, reversed digest, custom base64), cross-checked against AnyPS5's headers and hardware-derived packet sizes.
Batch 1 — GetSize entry points whose builders exist in-tree (sizes = builder
AllocateDWx 4 bytes):sceAgcAcbEventWriteGetSize(2 dw),sceAgcAcbDmaDataGetSize(7 dw),sceAgcAcbRewindGetSize(delegates toAgcDcbRewindGetSize),sceAgcAcbDispatchIndirectGetSize(4 dw)sceAgcDcbSetShRegisterDirectGetSize/SetUcRegisterDirectGetSize(3 dw),sceAgcDcbSetIndexSizeGetSize(3 dw),sceAgcDcbSetIndexBufferGetSize(3 dw),sceAgcDcbSetIndexCountGetSize(2 dw),sceAgcDcbDrawIndexIndirectGetSize(5 dw),sceAgcDcbDrawIndirectMultiGetSize(16 dw),sceAgcDcbDrawIndexIndirectMultiGetSize(10 dw),sceAgcDcbGetLodStatsGetSize(5 dw),sceAgcDcbStallCommandBufferParserGetSize(2 dw)Batch 2 — sync/atomic imports:
sceAgcAcbSetWorkloadsActive/sceAgcAcbSetWorkloadComplete: delegate to the existing Dcb builders (same 18/12-word packets, signatures confirmed against AnyPS5)sceAgcDcbMemSemaphore(G0jrLdvEqDw): delegates toAcbMemSemaphoresceAgc{Acb,Dcb}AtomicMemGetSize= 36,sceAgc{Acb,Dcb}AtomicGdsGetSize= 44,sceAgcAcbPrimeUtcl2GetSize= 20 (sizes from AnyPS5's hardware-verified implementations)Batch 3 — PrimeUtcl2 builders:
sceAgcAcbPrimeUtcl2(szG7hz2yEhA) andsceAgcDcbPrimeUtcl2(jt3pl7EN17o): 5-word NOP-payload packets matching AnyPS5's layout and the 20-byte GetSize. An earlier draft of this PR mappedjt3pl7EN17oto DcbMemSemaphore — NID hash verification corrected that.Import lists cross-checked against the unresolved-import logs attached to #2277 and #810.
Not covered (no in-tree builder or authoritative size yet): AtomicMem/AtomicGds builders, CbCondWrite, CbMemsetExclusive, SetIndexIndirectArgs, occlusion queries, submit-validation/capture driver APIs.
Verified: full Windows build (clang-cl) and
shader_cfg_testspass.@chatgpt-codex-connector[bot] on GitHub · 2026-11-20 06:26 UTC · original · edited 2026-11-20 06:28 UTC
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
f60ddd5ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
@coderabbitai[bot] on GitHub · 2026-11-20 06:30 UTC · original · edited 2026-11-20 08:00 UTC
No actionable comments were generated in the recent review.
Walkthrough
The Gen5 API adds ACB workload operations, ACB and DCB UTCL2 priming operations, and a DCB memory-semaphore operation. It adds packet-size queries for selected ACB and DCB commands. The query implementations return sizes in bytes, and the ACB rewind query returns the DCB rewind size. The Graphics5 symbol table registers the added operations and size queries.
Suggested reviewers:
nmzik,opcod3Change: Bug fix
Merge Risk:
Minimal · up to
ccb29This change registers the missing AGC size queries and the PrimeUtcl2 and semaphore entry points, so imports no longer resolve to a stub that returns 0. No concrete defect was found in the changed code, and the DCB semaphore concern was ruled out by source inspection. The change is ready to merge.
Pre-merge checks:
4
Full details: Title check
Explanation
The title names the main change: registering 14 sceAgc*GetSize entry points that GTA V imports. The changeset adds these GetSize registrations and wrappers in agc.cpp, agc.h and libAgcDriver.cpp. The title says 14 entry points, but the changeset and description list more GetSize functions than that count, so the count is not exact. The core subject still matches the change.
Full details: Description check
Explanation
The description states that GTA V imports unregistered sceAgc*GetSize functions, which return 0 from the unresolved-import stub. It lists the three batches of added GetSize entry points, PrimeUtcl2 builders, and sync/atomic wrappers. It also gives NID verification, cross-checks against unresolved-import logs, the build and test results, and the items left uncovered. This matches the changeset, which adds these functions in agc.cpp, agc.h, and libAgcDriver.cpp.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
ef53bfc8-09ac-41ad-9cd0-b7de056dba35Reviewing files that changed from the base of the PR and between
de5a949442andccb29c3671.src/libs/agc.cppsrc/libs/agc.hsrc/libs/libAgcDriver.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.