Issue #65 - Fix rendering glitches during startup#67
Merged
Conversation
The way in which the plug-in handled changes to display scale and texture format was allowing draw data constructed from the old settings to be rendered using the new settings, despite it being incompatible. To fix this, during the extract stage, we now drop the incompatible draw data when we detect a change in display settings, and re-create a renderer for the next frame only. This guarantees that the draw data for a context is only ever rendered by a compatible renderer. In implementing this, the context and render context has been cleaned up, where all of the state required to keep track of this has now been moved from the render context into the game-thread context, and factored inside a ImguiExtractState struct. Also took the opportunity to do a bit of spring cleaning: - Types all now use 'Imgui' rather than a mixture of that and 'ImGui' - Changed variable naming to consistently use `imgui_context` and `render_context` to make it easier to understand the types
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The way in which the plug-in handled changes to display scale and texture format was allowing draw data constructed from the old settings to be rendered using the new settings, despite it being incompatible.
To fix this, during the extract stage, we now drop the incompatible draw data when we detect a change in display settings, and re-create a renderer for the next frame only. This guarantees that the draw data for a context is only ever rendered by a compatible renderer.
In implementing this, the context and render context has been cleaned up, where all of the state required to keep track of this has now been moved from the render context into the game-thread context, and factored inside a
ImguiExtractStatestruct.Also took the opportunity to do a bit of spring cleaning:
Imguirather than a mixture of that andImGuiimgui_contextandrender_contextto make it easier to understand the types