feat(libSceAgc): ignore address argument on non-sample-dump events in sceAgcDcbEventWrite #5219
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5219"
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 pushkarreddyy on 2026-10-13T14:59:58Z.
What
In
libSceAgc'ssceAgcDcbEventWrite, non-sample-dump event types (events other than0x38and0x39) emit a 2-dword PM4 packet0x46(IT_EVENT_WRITE) without trailing address dwords. Previously,sceAgcDcbEventWriteassertedaddress == nullptrfor all such event types, throwingstd::runtime_error("sceAgcDcbEventWrite: this event does not use an address")when passed a non-null address.Retail titles such as Void Terrarium (
PPSA03061) callsceAgcDcbEventWritepassing a non-null address buffer (0x00000002d2a10000) alongside cache-flush event type0x16. On hardware, this event does not consume an address in the PM4 command stream andeventIndexremains0u, so requiringaddress == nullptrin guest user-space artificially halts execution.This change:
address == nullptrrequirement insceAgcDcbEventWritefor non-sample-dump events, allowing titles to pass unused address buffers without throwing.0x38and0x39.0x400ufor events 7, 15, and 16, while emitting index0ufor cache-flush and other general events.core/libs/prx/libSceAgc/tests/Commands.cppverifying packet emission, size queries, and null/non-null address tolerance across all event classes.docs/dev/debt/libSceAgc.md.Tested
core/libs/prx/libSceAgc/tests/Commands.cpp(testEventWrite):0x38and0x39emit 4 dwords (16bytes) with{0x100u | eventType, addrLo, addrHi}.0x38and out-of-range event types (0x40).7,15,16emit 2 dwords (8bytes) with index0x400u.0x16emits 2 dwords (8bytes) with index0uboth with null and non-null addresses.PPSA03061, #5055) halts onorigin/mainat: With this change applied, the title progresses pastsceAgcDcbEventWriteand continues into shader execution and presentation.Checklist
tools/check_conventions.pyImported from boykopovar/AnyPS5. Originally posted by p3n1cillin on 2026-10-13T20:04:45Z.
Confirmed on Void Terrarium (PPSA03061): without this PR the game stops on
sceAgcDcbEventWrite: this event does not use an address. With it (plus #5153, #5425 and #5140) the game runs for 150 s with no library stop. Details in https://github.com/boykopovar/AnyPS5/issues/5055#issuecomment-6154121860Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-13T23:04:05Z.
agc_commandsfails on Windows with this PR's newtestEventWrite:incorrect event 0x38 return pointer. The check issamplePacket == storage.words.data() + 4(tests/Commands.cpp, first check oftestEventWrite), butAgc::Command::Emitreturns the start of the packet (return packet;afterAllocate,Packet.cpp), which isstorage.words.data()for a fresh buffer. The same test passes onmainwithout this PR (3 of 3 runs); with this PR on its own it fails in 3 of 3 runs, and also in 3 of 3 runs in a build together with thirteen other PRs.I have not tried changing the expectation to
storage.words.data(). Windows 10 (19045), MinGW-w64 GCC 15.2, Release, NVIDIA GeForce RTX 4080 SUPER (driver 610.74). Not tested: Linux, AMD.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-14T02:07:23Z.
@xXPBSXx Good catch on the return pointer assertion! Updated the test check to samplePacket == storage.words.data() (matching Agc::Command::Emit returning the packet start) and rebased cleanly on latest origin/main.
Calling on @MarcZX100 for review / merge clearance alongside #5140.