fix(libSceGnmDriver): lower the PS4 packets in command buffers a compute ring calls #20384
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/20384"
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 Gag21 on 2026-11-15T03:47:06Z.
What
A PS4 title (CUSA01709 01.02) submits its compute work through
sceGnmDingDongas rings that call other command buffers withINDIRECT_BUFFER.sceGnmDingDonglowered only the packets in the ring itself, so the PS4 packets in the called buffers reached the AGC executor unchanged and the submission was refused:The debt file already recorded the gap ("Command buffers a ring calls are not lowered"). The
DMA_DATAabove is the PS4 SDK's tag prefetch, which the lowering already turns into a NOP when it sees it.sceGnmDingDongnow copies a buffer a ring calls with a plainINDIRECT_BUFFERand lowers its packets in place of the call, up to two levels below the ring (the hardware's IB1 and IB2). A third level, and aREWINDin a called buffer, throw throughNotImplemented_nid_no_patch. Predicated, chained and conditional calls are passed on as before.RELEASE_MEM: it becomes the eight-dword form the executor takes, without the compute header bit and with a zero context dword. The layout is shadPS4'sPM4CmdReleaseMem. A destination select other than memory throws; any other size is refused.docs/dev/debt/libSceGnmDriver.md: the "not lowered" sentence is replaced by an entry that says what is still not lowered, what throws, and that a called buffer is read once, whensceGnmDingDongis called.One difference to be aware of: the executor rereads a called buffer behind a wait, and a buffer lowered here is a copy taken at
sceGnmDingDong. That is the same as for the bufferssceGnmSubmitCommandBufferslowers.Tested
Windows 11 Pro 10.0.26300, i5-6600K, RTX 3070 (driver 621.01), WinLibs GCC 16.2.0, CMake 4.4.4, Ninja, Release,
BUILD_TESTING=ON.The build that was tested is a local branch with other unmerged changes plus exactly this diff (the code lines of the two source files were compared and are identical). This branch itself, on
main2d74858c14, was not built locally.gnm_driver_compute_queuehas a new case: a ring calls a buffer holding a PS4 32-bitRELEASE_MEMwith the compute header bit, the SDK's tag prefetchDMA_DATA, aWRITE_DATAand a call to a second buffer holding a 64-bitRELEASE_MEM. All three stores land and the read offset moves. A call three levels below the ring, aRELEASE_MEMwith a cache destination, and an eight-dwordRELEASE_MEMin a called buffer throw, and nothing of a refused submission runs. It passes.sceGnmDingDonglowering only the ring again, the test fails with the title's error:AGC driver: RELEASE_MEM at DWORD 0: PM4 header flags 0x2 are not implemented.guest_gnm_driver,gnm_driver_packetsandgnm_driver_submit_waitpass.DB_RENDER_CONTROL depth copy, resummarize or decompress is unsupported), which is a separate gap.python tools/check_conventions.py --base origin/mainpasses.python tools/pr_overlap.py --branch fix/gnm-lower-called-compute-buffers --repo boykopovar/AnyPS5reports no overlap with open pull requests.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code