Skip to content
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

Improve webgl lineFeature and polygonFeature. #1016

Merged
merged 3 commits into from
Oct 4, 2019

Conversation

manthey
Copy link
Contributor

@manthey manthey commented Aug 21, 2019

Reduce memory transfer to the gpu when only styles have changed in lines or polygons.

Rename some internal variables in the line feature to make it clearer.

Use constants to avoid array lookups in a few spots.

orderLen = order.length,
posBuf, prevBuf, nextBuf, farBuf, flagsBuf, indicesBuf,
posBuf, prevBuf, nextBuf, farBuf, flagsBuf,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@manthey would it be possible to add some note here on each buffer type specifically the flags buff?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@@ -25,8 +25,10 @@ var flagsLineJoin = { // uses 3 bits with flagsLineCap
round: 6,
'miter-clip': 7
};
var flagsNearLineShift = 2, flagsFarLineShift = 5;
var flagsNearOffsetShift = 8; // uses 11 bits
var flagsNearLineShift = 2, flagsNearLineMult = 1 << flagsNearLineShift;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, if we add some code comment on how these flags are used, it would be be easy to remember and understand the code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aashish24 I've added more to the comment above all of the flag definitions.

Reduce memory transfer to the gpu when only styles have changed in lines
or polygons.

Rename some internal variables in the line feature to make it clearer.

Use constants to avoid array lookups in a few spots.
@manthey manthey merged commit 61d47af into master Oct 4, 2019
@manthey manthey deleted the webgl-line-improvements branch October 4, 2019 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants