When changing to another framebuffer, especially one smaller than the main framebuffer, if the viewport/scissor is ever changed the rendering API may truncate the values to align with the smaller framebuffer. This can cause unintended clipping when switching back to the larger main framebuffer.
Setting g_rdp.viewport_or_scissor_changed to true and wiping out the current rendering state allows the next triangle draw to reapply the original viewport/scissor values again based on the main framebuffer size.
If more ports in the future do different things with switching framebuffers, we may want to consider tracking viewport values per framebuffer so that we can re-apply as needed.
When changing to another framebuffer, especially one smaller than the main framebuffer, if the viewport/scissor is ever changed the rendering API may truncate the values to align with the smaller framebuffer. This can cause unintended clipping when switching back to the larger main framebuffer.
Setting
g_rdp.viewport_or_scissor_changed
to true and wiping out the current rendering state allows the next triangle draw to reapply the original viewport/scissor values again based on the main framebuffer size.If more ports in the future do different things with switching framebuffers, we may want to consider tracking viewport values per framebuffer so that we can re-apply as needed.