forked from electronicarts/CnC_Generals_Zero_Hour
-
Notifications
You must be signed in to change notification settings - Fork 180
perf(gui): Significantly reduce cost of 2d render elements #2514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
githubawn
wants to merge
25
commits into
TheSuperHackers:main
Choose a base branch
from
githubawn:perf/gui-batch
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+486
−156
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
3c67c93
perf(gui): Implement batched GUI rendering for improved performance
githubawn dd7e822
centralized logic into setup2DRenderState
githubawn bfd6c1e
prevent some possible state leakage
githubawn f02e944
fix batch execution order and texture lifetime bug
githubawn b40f7bd
initialize m_batchNeedsInit in constructor
githubawn 6d17889
defer Release_Ref until after m_2DRender->Render():
githubawn f52030a
resolve texture leak
githubawn b4ddceb
move off screen clipping after the null check
githubawn 2497ea1
fix order call in draw_image_additive
githubawn aaaff88
remove unneeded DRAW_IMAGE
githubawn 6d28a51
properly initialize m_batchNeedsInit in constructor
githubawn 8ddb66e
fix DRAW_IMAGE_GRAYSCALE to explicitly call Enable_Alpha(TRUE)
githubawn b280e5b
optimize m_textRendererHotKey
githubawn 93132b4
optimize m_textRendererHotKey
githubawn 683fb14
Merge branch 'perf/gui-batch' of https://github.com/githubawn/General…
githubawn 0efede5
add missing curly bracket
githubawn 53badb9
simplify onflush
githubawn 5d9405a
Move HUD batching from GameWindowManager to W3DInGameUI::draw()
githubawn 13fc763
replicated to generals
githubawn 667d24d
implement review feedback
githubawn 8bec215
fix generals replication
githubawn 125ef7e
implemented review feedback
githubawn ef09949
implemented some feedback
githubawn 682c1cf
use correct REF_PTR_RELEASE
githubawn 60f1e41
replicated change to generals
githubawn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Submodule GameClient_Reference
added at
626600
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -113,6 +113,15 @@ class Display : public SubsystemInterface | |
| virtual Bool isClippingEnabled() = 0; | ||
| virtual void enableClipping( Bool onoff ) = 0; | ||
|
|
||
| // TheSuperHackers @info start batching 2D draw operations. | ||
| virtual void beginBatch(); | ||
| // TheSuperHackers @info stop batching and flush pending 2D draw operations. | ||
| virtual void endBatch(); | ||
| // TheSuperHackers @info flush pending 2D draw operations without ending the batch. | ||
| virtual void flush(); | ||
| // TheSuperHackers @info returns true if currently batching 2D draw operations. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The following style would fit the overall commenting style better: // TheSuperHackers @performance Blabla
virtual void beginBatch(); ///< EA style function comment here
virtual void endBatch(); ///< EA style function comment here
virtual void flush(); ///< EA style function comment here |
||
| virtual Bool isBatching() const { return m_isBatching; } | ||
|
|
||
| virtual void step() {}; ///< Do one fixed time step | ||
| virtual void draw() override; ///< Redraw the entire display | ||
| virtual void setTimeOfDay( TimeOfDay tod ) = 0; ///< Set the time of day for this display | ||
|
|
@@ -182,11 +191,15 @@ class Display : public SubsystemInterface | |
| virtual Int getLastFrameDrawCalls() = 0; ///< returns the number of draw calls issued in the previous frame | ||
|
|
||
| protected: | ||
| virtual void onBeginBatch() { } | ||
| virtual void onEndBatch() { } | ||
| virtual void onFlush() { } | ||
|
|
||
| virtual void deleteViews(); ///< delete all views | ||
| UnsignedInt m_width, m_height; ///< Dimensions of the display | ||
| UnsignedInt m_bitDepth; ///< bit depth of the display | ||
| Bool m_windowed; ///< TRUE when windowed, FALSE when fullscreen | ||
| Bool m_isBatching; | ||
| View *m_viewList; ///< All of the views into the world | ||
|
|
||
| // Cinematic text data | ||
|
|
||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.