feat(agc): emit indexed indirect draws #40

Merged
Pacuka merged 1 commit from upstream-pr/40 into main 2026-09-28 05:08:48 +00:00
Pacuka commented 2026-09-27 17:43:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Pacuka on 2026-09-27T17:43:20Z.


Summary

This implements sceAgcDcbDrawIndexIndirect and sceAgcDcbDrawIndexIndirectMulti. They were stubs that aborted with "not implemented".

They follow the existing non-indexed sceAgcDcbDrawIndirect / DrawIndirectMulti:

  • DrawIndexIndirect emits DRAW_INDEX_INDIRECT (0x25): data offset, base vertex / start instance SGPR locations, draw initiator (5 dwords, matching GetSize = 20).
  • DrawIndexIndirectMulti emits DRAW_INDEX_INDIRECT_MULTI (0x38): the same fields, plus the draw-index location / count-indirect control word, count, count address and stride (10 dwords, matching GetSize = 40). The stride must be at least 20, the size of an indexed record.

The packet layout matches what resolveIndirectDraw in #5 reads for 0x25/0x38.

Testing

  • New testIndexedIndirectDraws in agc_command_tests: it checks the exact packets of both functions, and that a misaligned offset, a stride below 20, and a count address given for a direct count are all rejected without writing packets. The whole agc_command_tests run passes on Linux.
  • Full build plus libs; ctest passes 36/36.
  • On a local branch based on #5, The Smurfs Dreams (UE) calls sceAgcDcbDrawIndexIndirect from its menu. With this change it gets past that call and keeps rendering; it used to abort there.

Overlap check: #24 changes sceAgcDcbDrawIndex in the same file, in a different hunk.

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4655625138 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/40). Originally posted by [Pacuka](https://github.com/Pacuka) on 2026-09-27T17:43:20Z. --- ## Summary This implements `sceAgcDcbDrawIndexIndirect` and `sceAgcDcbDrawIndexIndirectMulti`. They were stubs that aborted with "not implemented". They follow the existing non-indexed `sceAgcDcbDrawIndirect` / `DrawIndirectMulti`: - `DrawIndexIndirect` emits `DRAW_INDEX_INDIRECT` (0x25): data offset, base vertex / start instance SGPR locations, draw initiator (5 dwords, matching `GetSize` = 20). - `DrawIndexIndirectMulti` emits `DRAW_INDEX_INDIRECT_MULTI` (0x38): the same fields, plus the draw-index location / count-indirect control word, count, count address and stride (10 dwords, matching `GetSize` = 40). The stride must be at least 20, the size of an indexed record. The packet layout matches what `resolveIndirectDraw` in #5 reads for 0x25/0x38. ## Testing - New `testIndexedIndirectDraws` in `agc_command_tests`: it checks the exact packets of both functions, and that a misaligned offset, a stride below 20, and a count address given for a direct count are all rejected without writing packets. The whole `agc_command_tests` run passes on Linux. - Full build plus `libs`; `ctest` passes 36/36. - On a local branch based on #5, The Smurfs Dreams (UE) calls `sceAgcDcbDrawIndexIndirect` from its menu. With this change it gets past that call and keeps rendering; it used to abort there. Overlap check: #24 changes `sceAgcDcbDrawIndex` in the same file, in a different hunk. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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!40
No description provided.