perf(agc): draw templates rebind moved read-only buffers and data words #424
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/424"
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 MichonGoddijn231849 on 2026-10-02T23:33:25Z.
What
A draw resource template is keyed by every descriptor word of its stages. Titles that stream constants and vertices through rings move their buffers on every draw, so the V# base and size of read-only buffers, and the ShaderData/FlattenedSrt words, differ for each draw. Templates then never hit, and every draw built its resources from scratch.
ContentKeygainsmovableBuffers. Read-onlyGuestBufferselements are keyed by their layout bits only ({0, w1 & 0xffff0000, 0, w3}), and data-role words leave the key.MovedReadOnlyBufferscompares the template's bindings with the draw's:PrepareDrawBindingstakes the moved buffers and snapshots them from their new ranges. A draw that is not recorded lean rebuilds its resources, so nothing changes for synchronous draws.APS5_NO_MOVED_BUFFER_TEMPLATES=1keys the words as before.Tested
Windows 11 Pro, AMD Ryzen 5 7600, NVIDIA GeForce RTX 5080 (driver 32.0.16.1074), 32 GB DDR5-5600, MinGW-w64 GCC 15.2.0.
ctest: all tests pass.APS5_PROFILE_DRAW=1:Graphics::Drawdropped from 37.6 to 26.1 µs per draw packet;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🤖 Generated with Claude Code