perf(agc): reuse a draw's index and vertex copies while the guest bytes are unchanged #277
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/277"
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 oneandonlydean on 2026-10-01T21:36:42Z.
What
Every draw copies its index and vertex ranges from guest memory into fresh buffers and scans the indices for the highest one, although the draws of a frame read the same meshes again.
CopyDrawInputnow keeps those copies in the recorder's draw snapshot cache from #276. It binds a kept copy again while the write tracker proves the range unchanged since the copy was taken, with the same rules as the storage-buffer snapshots:UnchangedSinceholds on the collect made right before the copy;As
GuestMemory::Readdoes,FlushGpuWritesruns first, so pending GPU results over the range are stored and stamped before the check. Unwatched memory is copied every time, and a draw without a recorder copies as before. The caller still checks the range's access and alignment for every draw. An index copy keeps its highest index, and the device'smaxDrawIndexedIndexValueis still checked for every draw.Measured in PPSA21564 on my integration branch:
Tested
Linux (CachyOS, RTX 4090). New
drawInputReuseTestsinagc_driver_recorder_tests(a GPU test, built but not part of ctest) runs over write-watched memory. It requires:MarkWrittenstore and after a registry mutation;drawSnapshotEvictionTestsnow also requires that filling the storage pool past its cap keeps a vertex snapshot.These tests call
CopyDrawInput, which this PR adds, so they cannot run on the base branch. Instead I confirmed that each part fails without its change:ctest --test-dir build --timeout 120: 96/96 pass with this branch on current main.agc_driver_recorder_tests,agc_driver_graphics_testsandagc_structurizer_testspass when run directly.Exercised in PPSA21564 on my integration branch (numbers above), which passes my visual regression check.
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