-
Notifications
You must be signed in to change notification settings - Fork 7
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
More imagery refactoring #389
Merged
Merged
Conversation
This file contains 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
lilleyse
requested review from
weegeekps,
r-veenstra,
corybarr and
mattelser
as code owners
July 7, 2023 23:25
lilleyse
force-pushed
the
imagery-refactor-part-2
branch
from
July 10, 2023 20:19
112aa28
to
52b0760
Compare
This is ready for review now. I fixed the merge conflict with #308. |
weegeekps
approved these changes
Jul 12, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved. There's one documentation related nitpick. If you fix it, don't worry about re-approval. I still approve.
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.
Continuation of the work started in #384.
Added a texture pool that holds onto
DynamicTextureProvider
objects. Textures are now a distinct resource type that can be assigned to multiple materials. This allows multiple tiles to reference the same imagery, which happens when child tiles use their parent's imagery while waiting for higher res imagery. Previously we were copying the imagery due to limitations in Kit 104.On the performance side, imagery preparation has been offloaded to a worker thread. I think we can do the same for glTF base color textures, I just haven't done it in this PR.
Aside from new files, the main changes are in
FabricPrepareRenderResources
andFabricMaterial
.GltfUtil
was refactored heavily to consolidate a bunch of the getters. I'll wait for #387 to be merged first.As a bonus, this PR adds support for
KHR_texture_transform
because it just neatly fit into the refactoring.What's next
This PR is a stepping stone towards a bigger performance fix. One of the biggest bottlenecks is material compilation, and I think instead of creating a material for each cached tile we can create a material for each selected tile. This will cut the number of materials down from 2000-50000 (depending on your cache size) to around 200-500 (depending on the tileset and your SSE). Any time we allocate lots of materials we get a 10+ second main thread stall, which in my opinion is the most glaring usability issue with the extension right now.
With Kit 105 and the refactoring in this PR we should be able to make a material pool for selected tiles only and update texture paths dynamically.