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

BatchedMesh: Avoid primitive restart values in index array #28641

Merged
merged 2 commits into from
Jun 14, 2024

Conversation

donmccurdy
Copy link
Collaborator

WebGL 2 uses the last index value (255 for u8, 65535 for u16, or 4294967295 for u32) as a primitive restart value, so we should avoid using that index for real vertices.

Copy link

github-actions bot commented Jun 12, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize dev Filesize PR Diff
679.4 kB (168.3 kB) 679.4 kB (168.3 kB) +0 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Filesize dev Filesize PR Diff
457.4 kB (110.4 kB) 457.4 kB (110.4 kB) +0 B
@gkjohnson
Copy link
Collaborator

Nice find! This seems like something that would be worth adding an inline comment for.

@mrdoob mrdoob added this to the r166 milestone Jun 13, 2024
@donmccurdy
Copy link
Collaborator Author

Good call, done!

@Mugen87 Mugen87 merged commit 376f997 into mrdoob:dev Jun 14, 2024
12 checks passed
@donmccurdy donmccurdy deleted the fix/batchedmesh-primitive-restart branch June 14, 2024 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants