Skip to content

feat(agc): emit indexed indirect draws - #40

Merged
boykopovar merged 1 commit into
boykopovar:mainfrom
Pacuka:feat/agc-draw-index-indirect
Sep 28, 2026
Merged

boykopovar merged 1 commit into
boykopovar:mainfrom
Pacuka:feat/agc-draw-index-indirect

Conversation

@Pacuka

@Pacuka Pacuka commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

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 Boot Demon's Souls to its first level: AGC recorder driver, runtime, audio, Bink fixes #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

sceAgcDcbDrawIndexIndirect and sceAgcDcbDrawIndexIndirectMulti emit
DRAW_INDEX_INDIRECT (0x25) and DRAW_INDEX_INDIRECT_MULTI (0x38) like their
non-indexed counterparts, with 20-byte records.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@boykopovar
boykopovar merged commit f38e976 into boykopovar:main Sep 28, 2026
Kikoarl pushed a commit to Kikoarl/AnyPS5 that referenced this pull request Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants