perf(view): Cache only latest screen-to-terrain result#2992
Merged
xezon merged 5 commits intoJul 24, 2026
Merged
Conversation
|
| Filename | Overview |
|---|---|
| Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp | Replaces the screen-to-terrain cache and adds invalidation for changed view state. |
| Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DView.h | Stores the latest screen-to-terrain result and clears it when terrain or bridge state changes. |
| Core/GameEngineDevice/Source/W3DDevice/GameClient/BaseHeightMap.cpp | Routes full heightmap update scheduling through a helper that also invalidates the view cache. |
| Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainVisual.cpp | Clears the view cache after seismic terrain updates. |
| Generals/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp | Clears the view cache when bridge logic adds, deletes, or updates bridge state. |
| GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp | Mirrors the bridge cache invalidation changes for Zero Hour. |
Reviews (3): Last reviewed commit: "refactor(view): Refine screen-to-terrain..." | Re-trigger Greptile
xezon
reviewed
Jul 22, 2026
xezon
left a comment
There was a problem hiding this comment.
Code looks complicated. Would be good to simplify it somehow.
xezon
reviewed
Jul 23, 2026
CryoTheRenegade
force-pushed
the
fix/W3DViewm-locationRequests-single-cache-conversion
branch
from
July 23, 2026 20:04
3e169f4 to
b089b42
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.
Summary
In #2815 I profiled
W3DView::m_locationRequestsand found that only the newest entry was reused out of the 40 entry cache. The movement (moving camera in replays) test produced 33,590 newest-entry hits, while older cached entries had no hits.This change replaces the 40 entry cache with a single entry cache that tracks bridge and seismic additions, deletions, and damage-state changes persistently so we can invalidate the entry when a change occurs.