perf(agc): pre-check indirect draw argument and count buffer coverage #4868
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4868"
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 Kikoarl on 2026-10-13T00:41:13Z.
What
Narrows PR #4868 strictly to the indirect draw argument and count buffer coverage checks (per @oneandonlydean review):
ClassifyIndirectDraw(IndirectDraw.cpp), verifies that indirect argument buffer ranges (indirect.RangeBytes()) and indirect count buffer (indirect.countAddress) are backed by registered readable guest memory usingGraphics::RegisteredReadableCovers(...).Path::NotImportedto execute cleanly on the CPU path rather than failing or trapping in backend GPU indirect buffer setup.docs/dev/debt/libSceAgcDriver.md.tests/execution/DrawOffsetIndices.cppasserting that unmapped argument buffers and unmapped count buffers are classified toPath::NotImported.(Note: Per Dean's recommendation, the other three bundled mechanisms have been separated: compute pipeline lookup is ceded to @karanvora2599's #4897, while the GpuMutex record unlock and dispatch coverage checks are deferred to separate atomic PRs).
Performance & Telemetry (Astro Bot PPSA21567)
Measured across alternating 10-second runs on Astro Bot intro/gameplay transition scene against base
8299b2f7e:main(8299b2f7e)main + #4868Path::NotImportedearly exit)main(8299b2f7e)main + #4868main(8299b2f7e)main + #4868Tested
PPSA21567)agc_driver_draw_offset_indices_tests(verifies unmapped argument buffer and unmapped count buffer classification toPath::NotImported). All tests pass.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)Imported from boykopovar/AnyPS5. Originally posted by karanvora2599 on 2026-10-13T02:40:43Z.
@Kikoarl, a heads-up: #4897 overlaps with point 4 here. It also adds
PreparedDispatch::objects, but itsPrepareDispatchcreates a missing compute pipeline as well as looking one up.VulkanDevice::computePipelinefinds the pipeline incomputePipelines, or creates and inserts it. A per-key future means two queues that need the same variant create it once.GpuMutexinstead of under it.The lookup your point 4 adds is the first step of
computePipeline, so the two PRs touch the same lines. Whichever lands second needs a small rebase. If #4868 goes in first, I'll rebase #4897 onto it.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T09:21:01Z.
Please split this into four PRs, each with its own test and before/after (#218): unlocking
GpuMutexbetween CPU-indirect records, the argument/count coverage check for indirect draws, the same plus the pending-image flush for indirect dispatch, and the compute pipeline lookup inPrepareDispatch(which overlaps #4897; agree with its author which goes first). The unlock has no test yet, and each re-lock runsrecordLabelsForPacketagain, so please show it doesn't add submits. It also needs a rebase:docs/dev/debt/libSceAgcDriver.mdconflicts with main.Imported from boykopovar/AnyPS5. Originally posted by Kikoarl on 2026-10-13T09:37:52Z.
Thanks @oneandonlydean. Fully agree with splitting into atomic PRs and keeping changes isolated:
ClassifyIndirectDraw).GpuMutex.origin/main(8299b2f7e), resolving conflicts indocs/dev/debt/libSceAgcDriver.mdand documenting only the unmapped fallback behavior.DrawOffsetIndices.cppverify rejection of unmapped argument buffers and count buffers toPath::NotImported. Updated the PR description with the 3-run alternating telemetry table against base8299b2f7e.Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-13T18:03:01Z.
Rebase handoff — rebased onto current
main(staleness only, applied cleanly), authorship unchanged.Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON, AMD RX 9070 XT / RADV):tools/check_conventions.py --base origin/mainpassesmainregression (agc_driver_tessellationsegfault, #4727)To pick it up:
Head is
0e22e3cd4.Imported from boykopovar/AnyPS5. Originally posted by Kikoarl on 2026-10-13T18:59:02Z.
Picked up the rebase onto latest main
18c438b10. Thanks @blawesom for the rebase handoff and test verification on AMD.Imported from boykopovar/AnyPS5. Originally posted by karanvora2599 on 2026-10-13T21:53:54Z.
Thanks @Kikoarl. I've updated #4897's description to say the pipeline lookup is there now.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T22:05:43Z.
Thanks for the work on this. Closing for now: main already sends these records to the CPU path, since
Draw.cppreturnsNotImportedwhen the argument or count range has no host import, so this only makes the same decision earlier. You are welcome to reopen it with a title that issues indirect draws from unregistered memory and a measurement on that title.Pull request closed