More flexible texture matching, bias matching by the bind sequence counters #15857
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since we now have the bind sequence numbers, which should almost on its own be a fairly solid way of picking the right framebuffer (or its depth buffer) to texture from, I originally intended to simplify things a lot more, but decided to let the pile of heuristics in MatchFramebuffer live on for now, at least until we get deferred depth copies (and some will still be needed).
In addition to adding a match bias from the sequence number (so the most recent texture is more likely to be chosen if two are very similar), this always tries to match against both color and depth, instead of deciding based on the "depth swizzle" bits in the address. Turns out that games like Kuroyou will texture color from a "depth address" in order to apply the depth swizzle. Since we just ignore swizzle entirely, that's just a copy for us, but it still needs to happen. Some more details here.
The reason I want this in first is that without it, I can't fully test #15777 with the dumps from the game - and splitting it out will make bisection easier, as usual.