feat(libSceAgc): report occlusion query and index indirect argument packet sizes #1584

Closed
EdouardSence wants to merge 1 commit from upstream-pr/1584 into main
EdouardSence commented 2026-10-08 13:37:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EdouardSence on 2026-10-08T13:37:49Z.


What

Implements three libSceAgc size queries that titles call to reserve command-buffer space for builders the SDK inlines:

  • sceAgcDcbBeginOcclusionQueryGetSize(queryType): 16 bytes for type 0, 288 for type 1. Any other type throws.
  • sceAgcDcbEndOcclusionQueryGetSize(): 16 bytes.
  • sceAgcDcbSetIndexIndirectArgsGetSize(): 16 bytes.

Sources:

  • OpenAGC gives all four values.
  • SharpProspero agrees on the two fixed 0x10 sizes, and that the begin size depends on the query mode.
  • The 288-byte type 1 begin comes only from OpenAGC. It is recorded in TechnicalDebt, next to the existing predication GetSize entry.

sceAgcDcbSetIndexIndirectArgs itself stays unimplemented. AnyPS5 declares it as (buf, dataOffsetInBytes), while OpenAGC and SharpProspero both take an address plus a 32-bit value. The 0x91 packet it writes is also not handled by the driver.

Library progress: 2572 → 2575 of 3034.

Tested

Linux (CachyOS, GCC), RX 9070 XT:

  • New agc_draw_packet_size_tests: checks the values, and that query type 2 throws.
  • Full ctest: 459/459.
  • tools/check_conventions.py passes.

No title calls these during the Astro Bot (PPSA21567) runs I have, so nothing was tested in-game.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes. The code, tests and this description were written by Claude (Claude Code) on my machine.

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4787651367 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1584). Originally posted by [EdouardSence](https://github.com/EdouardSence) on 2026-10-08T13:37:49Z. --- ### What Implements three libSceAgc size queries that titles call to reserve command-buffer space for builders the SDK inlines: - `sceAgcDcbBeginOcclusionQueryGetSize(queryType)`: 16 bytes for type 0, 288 for type 1. Any other type throws. - `sceAgcDcbEndOcclusionQueryGetSize()`: 16 bytes. - `sceAgcDcbSetIndexIndirectArgsGetSize()`: 16 bytes. Sources: - [OpenAGC](https://github.com/OpenAGC/OpenAGC/blob/main/src/game_compat.c) gives all four values. - [SharpProspero](https://github.com/SvenGDK/SharpProspero/blob/main/src/SharpProspero/Interop/Agc/SceAgc.cs) agrees on the two fixed 0x10 sizes, and that the begin size depends on the query mode. - The 288-byte type 1 begin comes only from OpenAGC. It is recorded in TechnicalDebt, next to the existing predication GetSize entry. `sceAgcDcbSetIndexIndirectArgs` itself stays unimplemented. AnyPS5 declares it as `(buf, dataOffsetInBytes)`, while OpenAGC and SharpProspero both take an address plus a 32-bit value. The 0x91 packet it writes is also not handled by the driver. Library progress: 2572 → 2575 of 3034. ### Tested Linux (CachyOS, GCC), RX 9070 XT: - New `agc_draw_packet_size_tests`: checks the values, and that query type 2 throws. - Full `ctest`: 459/459. - `tools/check_conventions.py` passes. No title calls these during the Astro Bot (PPSA21567) runs I have, so nothing was tested in-game. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes. The code, tests and this description were written by Claude (Claude Code) on my machine. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-08 13:38:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-08T13:38:26Z.


Progress report (4b005b2 → a6e9483)

📈 System libraries: 84.86% (+0.1%, +3 implemented functions)

✅ 3 implemented
Library Name
libSceAgc sceAgcDcbBeginOcclusionQueryGetSize
libSceAgc sceAgcDcbEndOcclusionQueryGetSize
libSceAgc sceAgcDcbSetIndexIndirectArgsGetSize
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6061121909 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1584#issuecomment-6061121909). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-08T13:38:26Z. --- <!-- progress-report --> ### Progress report (4b005b2 → a6e9483) 📈 **System libraries**: 84.86% (+0.1%, +3 implemented functions) <details> <summary>✅ 3 implemented</summary> | Library | Name | | - | - | | libSceAgc | `sceAgcDcbBeginOcclusionQueryGetSize` | | libSceAgc | `sceAgcDcbEndOcclusionQueryGetSize` | | libSceAgc | `sceAgcDcbSetIndexIndirectArgsGetSize` | </details>
oneandonlydean commented 2026-10-09 08:54:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T08:54:50Z.


Closing: as the description says, no title calls these three GetSize functions, so the only effect is the progress count. Please reopen when a title stops at one of them on main.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6077706622 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1584#issuecomment-6077706622). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-09T08:54:50Z. --- Closing: as the description says, no title calls these three GetSize functions, so the only effect is the progress count. Please reopen when a title stops at one of them on main.

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!1584
No description provided.