Improved rendering - #173
Open
kunitoki wants to merge 12 commits into
Open
Conversation
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (52.21%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #173 +/- ##
==========================================
- Coverage 80.98% 80.97% -0.01%
==========================================
Files 786 787 +1
Lines 82265 82333 +68
==========================================
+ Hits 66620 66670 +50
- Misses 15645 15663 +18
... and 6 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
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.
This pull request introduces a major architectural improvement to the rendering model for
SDLComponentNative, moving each window's rendering to its own dedicated render thread. This change decouples rendering from the message thread, improving responsiveness and allowing multiple windows to render in parallel without serializing on vsync waits. The update also introduces a clear separation between native UI attachment (which must happen on the message thread) and GPU resource management (which now happens on the render thread), and makes several thread-safety and performance improvements throughout the rendering pipeline.The most important changes are:
Render Thread Architecture:
SDLComponentNativenow renders each window on its own dedicated render thread. The component-tree walk and animation/logic run under aMessageManagerLock, while GL command submission and buffer swap happen unlocked, allowing multiple windows to render in parallel and keeping the message thread responsive. [1] [2]Native UI and GPU Resource Management Separation:
attachToWindowmethod toGraphicsContext(and implemented it for Metal) to attach rendering surfaces to native UI on the message thread. GPU resource resizing is now handled separately on the render thread viaonSizeChanged, ensuring thread safety and correct resource management. [1] [2] [3] [4]Render Loop and Synchronization Improvements:
SDLComponentNativeto use a dedicated thread (or timer on Emscripten), with explicit signaling for repaint requests and fine-grained sleep for frame timing. The rendering logic is now encapsulated in a newrenderFramemethod, and thread-safe atomic access is used for render flags. [1] [2] [3] [4] [5]Repaint and Resource Handling Fixes:
Platform and Build Configuration Updates:
renderDrivenByTimerto ensure correct behavior on Emscripten and other platforms, and removed unusedAsyncUpdaterinheritance. [1] [2]