-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
make symbol placement information transferrable between workers #2624
Conversation
@@ -29,6 +29,8 @@ function SymbolBucket(options) { | |||
this.showCollisionBoxes = options.showCollisionBoxes; | |||
this.overscaling = options.overscaling; | |||
this.collisionBoxArray = options.collisionBoxArray; | |||
this.symbolQuadsBuffer = options.symbolQuadsBuffer; | |||
this.symbolInstancesBuffer = options.symbolInstancesBuffer; |
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.
Can we call these Array
s instead of Buffer
s? We generally use the term Buffer
exclusively in the context of a WebGL buffer (though I'd like to phase that out too)
This is looking great! The code is tight and idiomatic. I made a couple superficial comments and am feeling 👍 about the direction here. |
387a23a
to
c68e579
Compare
Try re-installing
|
Ah yep, that was it @lucaswoj! |
Looks good
It might be nice to not need a special value for the empty case. Sync the
It could be that the tile doesn't have any features matching the bucket's filter. A good next step would be to get rid of the original |
b58061c
to
3f4d3a2
Compare
Update: Seems like the sort function I implemented for the Also, I think I should treat the texture varables in the |
f5b4a64
to
75032c5
Compare
I fixed the sort issue, and all but 2 of the remaining render tests pass if I set all the anchor point offset variables (tl, tr, bl, br) in the structArray to The tests that still fail are |
What is the downside to setting the anchor point offset variables to |
343d93a
to
6496115
Compare
@lucaswoj I'm not sure what the downside is, but I would guess it has to do with memory usage and/or speed of transfer from worker --> main thread. I ran all the bench marking tests and didn't get any warnings. Looks like it got significantly faster actually. The last remaining piece of this puzzle is figuring out why cross-tile collision detection is not working I have a feeling it has to do with the fact that we're not passing a true |
Seems to be an issue with how the 😭 |
37ba3c7
to
6d3923f
Compare
} | ||
}); | ||
|
||
map.addLayer({ | ||
"id": "route", | ||
"type": "line", | ||
"source": "geojson", |
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.
Please revert your changes to this file
…Instances and SymbolQuads create SymbolInstancesArray StructArrayType add symbolinstances and quads to struct arrays populate symbolInstanceBuffer and symbolQuadsBuffer transfer symbol buffers from worker --> main thread add symbolInstances and symbolQuads to tile.js
…ransferred back to the worker transferrable-symbol-buffer: refactor placeFeatures to use the structArrays add tex getter to symbol_quads StructArrayType add sort method to StructArray in order to sort overlapping symbols during label placement store structArray info for placeFeatures use structArray to render labels -- collision detection not working fix typo in collision boxes move sorting function, handle overlaps fix symbolQuad sort remove all this.symbolInstances array completely, change offset coordinates to Float32 fix formatting
…e the structArrays only to place symbol features on the map revert debug page rearrange methods for converting a StructArray into an array of StructTypes
5a51853
to
e268120
Compare
first step in the quest to make cross-source label placement a reality! re: #2516
next actions:
tests! I have no idea how to do this, so I will spend some time poking around the existing tests and try to crib from those to make sure the correct data is getting transferred.this is basically a refactor, no new functionality to testsymbol_buffer
data to a new worker where it could be processed together withsymbol_buffers
from other sources usingplaceFeatures()
at that time.also:
-1
as the index for the symbolquads that do not exist in a tile?