feat(agc): implement sceAgcDriverGetEqContextId #844
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/844"
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 merwie on 2026-10-06T09:00:22Z.
What
Implements
sceAgcDriverGetEqContextIdfor graphics events (filter -14). It returns the id the event was registered with insceAgcDriverAddEqEvent(ev->ident).PPSA12544 derives that id from its context (0 or 1 for graphics,
0x20 + 8 * pipe + queuefor compute) and reads it back to dispatch the event. Other filters, a null or misaligned event and an id above 32 bits throw. A TechnicalDebt entry records that the meaning is an assumption.Tested
Windows 11, Radeon RX 9070 XT, PPSA12544 (Hollow Knight: Silksong; bring-up: #726): the call no longer throws. Non-GPU
ctestpasses; theSubmittest registers an event and reads its id back.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 repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-06T09:00:49Z.
Progress report (
c5e1018→b540327)📈 System libraries: 86.09% (+0.04%, +1 implemented functions)
✅ 1 implemented
sceAgcDriverGetEqContextIdImported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-06T22:02:52Z.
Thanks. After the last batch this branch conflicts with main in
docs/dev/TechnicalDebt.md. Could you rebase onto main? The code doesn't need to change.Imported from boykopovar/AnyPS5. Originally posted by merwie on 2026-10-07T05:46:48Z.
Merged
mainand kept both sets ofTechnicalDebt.mdlines (main's Json2/UserService entries, then this PR'ssceAgcDriverGetEqContextIdentry). No code changed. I merged rather than rebased so the review history stays.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-07T16:14:43Z.
Review: CHANGES_REQUESTED
Thanks. Build and ctest pass here, and the new test fails without the change. A few things before this can go in:
src/libs/agc.cpp,AgcDriverGetEqContextId), a graphics event returnsev->data, the context id the interrupt was raised with (RenderContext::TriggerInterruptpasses it as trigger data), and other filters returnident. Onmain,sceAgcDriverGetEqEventTypealready returnsidentfor graphics events, so with this PR both functions return the same value for every graphics event. On our sidedatais the EV_CLEAR trigger count (Eq/src/Event.cpp:53), so returningdataisn't right either. Please explain in the PR which value the console returns and whyidentis the right one here (for example, becausemainroutes each interrupt to the registration whose id equals the queue,Event.cpp:35), and record that it differs from KytyPS5 in the TechnicalDebt line. Alternatively, carry the interrupt's context id into the event the way Kyty does.maininstead of merging it (CONTRIBUTING: no merge commits). The branch conflicts indocs/dev/TechnicalDebt.mdagain.docs/dev/TechnicalDebt.md:69): keep it generic and drop the title id. The id layout (0/1 graphics,0x20 + 8 * pipe + queuecompute) can stay.Submit.cpp:71covers the null pointer but not the misaligned one.GetEqEventTypetests both (Submit.cpp:63).Imported from boykopovar/AnyPS5. Originally posted by merwie on 2026-10-07T18:58:55Z.
Thanks for the careful review. Pushed 587528b2 (on top of a merge of
mainthat resolves theTechnicalDebt.mdconflict).identis the right value here becauseAgcDriverDeliverEopInterrupt(Event.cpp:35) triggers only the registration whose id equals the raising queue. So on our sideidentis by construction the context the interrupt came from, which is what Kyty passes as trigger data. Kyty'sdataslot holds the EV_CLEAR trigger count here, so it can't carry that. The submit test now checks this end to end: the graphics end-of-pipe event reports context 0 and the compute one 0x20. Agreed thatGetEqEventTypeandGetEqContextIdnow return the same value for graphics events. That follows frommainencoding the type inident. Carrying a separate context id through the event (as Kyty does) would need its own field in the trigger path, so I've kept it out of this PR.identis returned, and records that KytyPS5 returnsdatainstead.GetEqContextIdtoo.mainrather than rewrite pushed history. I've asked the account owner whether to rebase these branches. Until then this one has merges ofmain, and it squashes cleanly at merge time.agc_driver_testsand the non-GPU tests pass.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-07T20:06:40Z.
Review: APPROVED
Thanks, the answers hold:
AgcDriverDeliverEopInterrupt(Eq/src/Event.cpp:35) only triggers the registration whose id equals the raising queue, soidentis the context id here, and the TechnicalDebt line records the KytyPS5 difference.Checked: build + full ctest (400/400) on the PR merged onto
main; the newSubmit.cppchecks fail without the change (returningdatabreaks the end-of-pipe rows).What we added: rebased onto
mainwithout the two merge commits (CONTRIBUTING: no merge commits), keeping your two commits, plus one commit that carries over the final TechnicalDebt wording you had put in the merge. The resulting tree is identical to this branch merged ontomain. Merging.