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

Remove SegmentVector abstraction #11171

Open
mourner opened this issue Oct 25, 2021 · 1 comment
Open

Remove SegmentVector abstraction #11171

mourner opened this issue Oct 25, 2021 · 1 comment

Comments

@mourner
Copy link
Member

mourner commented Oct 25, 2021

We introduced SegmentVector class to be able to render layers with >2^16 vertices — by maintaining multiple views ("segments") in the vertex array with different offsets. However, according to WebGL best practices, OES_element_index_uint extension that allows 32-bit vertex indexing as opposed to 16-bit one is universally supported and can be relied upon. We could use it to remove the segments abstraction, using the extension to render >2^16 vertices with a single draw draw call, and removing the complexity around splitting and maintaining segments.

@arindam1993
Copy link
Contributor

arindam1993 commented Oct 25, 2021

We also create a new segment every time a new *-sort-key is encountered.

if (!segment || segment.vertexLength + numVertices > SegmentVector.MAX_VERTEX_ARRAY_LENGTH || segment.sortKey !== sortKey) {

The segment.sortKey !== sortKey part

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants