Repository navigation
The decal manager reads the trees' decal counts only after the decal store changed, not on every editor frame (#273) - #359
Merged
Conversation
…store changed, not on every editor frame (#273)
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.
Part of #273.
ChiselDecalManager.Updateruns on every editor frame. Even with nothing changed it asked every model's tree whether it was still valid and how many decals it had (GetDecalCount: another validity check and two lookups), about 2.6-3.2 us per model. On bm_c0a0a (41 models, 233 decals) the idle update cost 0.23-0.36 ms per frame.Changes
ChiselDecalStore.Versiongoes up whenever a tree's decals can have changed: when they are given (SetDecals), and when they go with their tree (ChiselTreeLookup.ReleaseTree,DisposeAllTrees).SetDecalscalls move the version; it takes that as seen, since the trees then have what it gave them.Timing
Idle
ChiselDecalManager.Updateon bm_c0a0a, 5 runs of 50 calls: main 0.234-0.361 ms, this branch 0.136-0.225 ms.Tests
ChiselTreeLookupTests.TheDecalStoresVersion_MovesWhenATreesDecalsCanHaveChanged: the version moves when decals are given, when a tree is destroyed and when all trees are released, and not when a count is read. Fails without theReleaseTreeor theDisposeAllTreesbump.ChiselDecalComponentTests.ATreesDecals_AreLookedAtAgain_OnlyWhenTheStoreChanged: a tree's decals removed behind the store's back are not noticed until the store says its decals changed. Fails when the counts are read on every update.Full EditMode suite: 3090 passed, 0 failed, 5 skipped.