Repository navigation
perf(gui): Rebuild static text only when its hotkey setting changes - #633
Open
tintinhamans wants to merge 1 commit into
Open
tintinhamans wants to merge 1 commit into
tintinhamans wants to merge 1 commit into
Conversation
… changes (TheSuperHackers#3443) (cherry picked from commit 2f023de)
tintinhamans
force-pushed
the
arctic/go/perf/static-text-rebuild
branch
from
October 15, 2026 22:28
5a34946 to
6631215
Compare
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 static text gadget calls
setUseHotkeyon every draw, and that always marked the text as changed. So every static text on screen rebuilt its sentence every frame, creating a new D3D surface and texture each time.setUseHotkeynow returns early when the setting and colour are unchanged. That per-frame rebuild was also hiding two other things, which are fixed here too.Render2DSentenceClass::Reset()cleared the hotkey parse setting, so it now leaves it alone anddraw()asks the hotkey renderer whether it has a sentence. And a clip region change did not redo the quads, sosetClipRegionnow marks them for a redo.This also removes
MonoSpacedfromRender2DSentenceClass, which was never read.This is the merged upstream TheSuperHackers#3443 (issue TheSuperHackers#3441), cherry-picked as is.
W3DDisplayStringexists once per game in this tree, so it is applied to both theGeneralsMDandGeneralscopies.Measured on the upstream build in a Zero Hour skirmish at 120 fps,
winRepaintwent from about 0.155 ms to 0.099 ms per frame, roughly a third less. Hotkey labels, turning the hotkey on and off, text changes and clip changes were checked on screen on the upstream build. Zero Hour builds here; theGeneralshalf could not be compiled in this tree.This branch was rebuilt on the merged upstream commit. The code is identical to the earlier version of this PR; the two commits are now the one upstream commit.