Fix framebuffer when loading states/branches with OpenGL-supporting cores #4333
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.
We used to load the framebuffer of savestates that had screenshots (including TAStudio branches) by copying (and potentially resizing) the image into the core's framebuffer. This does not work with the newer way for cores to provide video output (via OpenGL textures). This resulted in users seeing incorrect images after loading savestates on those cores.
This has been solved by creating a new, temporary IVideoProvider when loading states and using that instead of the core's IVideoProvider until the next frame advance.
Let me know if there are any potential issues with doing things this way. In particular, MainForm's new LoadStateCommon method does more things than TAStudio's branch loading did. I am not sure, but they seems like things that should happen. My Lua script that I regularly use appears to work correctly with this update, but I imagine there could be others that rely on the old behavior.
Check if completed: