perf(agc): draw cache keys on the user words each stage reads #493
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/493"
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-04T09:10:47Z.
What
Split out of #291, as discussed there. The draw cache key mixed all 32 user data words of every stage, so draws that differed only in words their programs never read got separate entries and decoded and compiled again. The key now mixes only the user words each stage's RSRC2 counts (USER_SGPR, including the high bit). The RSRC2 registers themselves stay in the key, so a different count is a different key.
APS5_DRAW_KEY_ALL_USER_WORDS=1mixes all 32 again.The other part of #291 is #494 (data-only hits, on top of this). #291's time-based failure memo is dropped.
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: everything that passes onmainhere passes. There's no unit test for the key itself:Driver::drawRegisterKeyis internal to the driver DLL, and no test target links the Execution code.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
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T09:52:50Z.
Thanks for splitting it. I checked the key against the decoder:
decodeDrawreads exactly the first USER_SGPR words (bits 1 to 5 plus USER_SGPR_MSB at bit 27, which matches SPI_SHADER_PGM_RSRC2_PS/GS/HS in Mesa's gfx10.json) from 0x0c, 0x8c and 0x10c. The RSRC2 registers stay in the key, and nothing else in the draw path reads the words past that count, so a shared entry can't give a different decode or compile. A unit test isn't really possible without a draw harness, so that's fine with me. Merged with current main it builds and passes the full ctest here. Since it changes which draws share a cache entry, I'll run it through PPSA21564 on my integration branch first; after that it's ready to merge from my side.Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-07T17:31:14Z.
Rebased onto current
main(now131adc17), no conflicts. Build and ctest pass.