Add compat flag to not load CLUTs from old framebuffers #17965
Merged
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.
Fixes #17373 by adding a compat flag to avoid loading CLUTs (palettes) from framebuffers not rendered to during the current frame.
#17373 is a LoadCLUT issue (where we load a palette from a framebuffer). Doesn't persist after a save/reload state, so it seems we end up reading a palette from a framebuffer that contains outdated data, maybe due to sticking around from a previous frame while in reality the game has replaced that memory with the correct data. Checking for changes in the memory area covered by framebuffers might be necessary to fix this without flags, which gets too risky to include in the upcoming release.
I don't think it's that common though that we need LoadCLUT from framebuffers from old frames, so perhaps we should eventually invert this flag, and make it the default - risk seems fairly high to erroneously load CLUTs from outdated framebuffers lingering around. I'll do that after the release though.