mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-21 08:12:09 -05:00
The draw cache sets each fresh stage capture against the variants it keeps (insertDrawEntry), and the dispatch cache sets a fresh capture against its front variant, by comparing every captured word. A 32,768-record table column is 262,144 of them, so each compare went through 1 MiB on each side even when both captures had copied the column from the same shared block. A variant now records the words it copied from a block the shader memory shares (SharedWords: where they sit in the capture and in the block, and a weak reference to the block; consecutive pages of one block join into one entry). SameCapturedWords takes the words both captures copied from the same place of the same block as equal, since a block never changes, and compares the words around them as before. Two blocks with equal words, words read into pages and a released block fall back to the word compare. The reference is weak, so a kept variant holds no block alive, and a released block's identity cannot pass to a new one: its control block stays until the last weak reference goes.