Fix stale vector tile data for tiles that missed dirty regions while not rendered#13624
Open
danielzhong wants to merge 2 commits into
Open
Fix stale vector tile data for tiles that missed dirty regions while not rendered#13624danielzhong wants to merge 2 commits into
danielzhong wants to merge 2 commits into
Conversation
Contributor
|
Thank you for the pull request, @danielzhong! ✅ We can confirm we have a CLA on file for you. |
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.
Description
Follow up to #13577.
I noticed that when I zoom the camera in and out, some tiles occasionally disappear and become invisible. However, it doesn't seem to be reproducible for everyone—for example, @donmccurdy couldn't reproduce it on macOS.
Below is a quick suggestion from GitHub Copilot that appears to fix the issue.
Dirty rectangles in
VectorProviderare transient, they are recorded during the provider'supdate()pre-pass, tested against rendered tiles, and cleared bymakeClean()at the end of the same frame. A tile that is outside the rendered set never gets a chance to test against them. When that tile later re-enters the rendered set,updateTileDatafinds no intersecting dirty rectangles and keeps its cachedVectorTileData, even though the underlying collections have changed.Added:
VectorProvider._changeCount: incremented each time a dirty rectangle is recorded.VectorProvider._changeCountAtClean: snapshot taken inmakeClean().VectorTileDatais stamped with the current_changeCountwhen baked, and re-stamped when it passes validation inupdateTileData.updateTileData, data stamped before the last clean may have missed dirty regions that were already consumed, so it is released and re-baked. Otherwise the existing dirty-rectangle intersection test applies as before.Issue number and link
Testing plan
Author checklist
- [ ] I have added my name toCONTRIBUTORS.mdCHANGES.mdwith a short summary of my changeAI acknowledgment
If yes, I used the following Tools(s) and/or Service(s):
GitHub Copilot
If yes, I used the following Model(s):
Fable 5.0