Skip to content

fix: prevent browser freeze when tessellating >50k vertices (dev-2.0)#8729

Open
Nixxx19 wants to merge 2 commits intoprocessing:dev-2.0from
Nixxx19:nityam/tessellation-freeze-fix-2.x
Open

fix: prevent browser freeze when tessellating >50k vertices (dev-2.0)#8729
Nixxx19 wants to merge 2 commits intoprocessing:dev-2.0from
Nixxx19:nityam/tessellation-freeze-fix-2.x

Conversation

@Nixxx19
Copy link
Copy Markdown

@Nixxx19 Nixxx19 commented Apr 17, 2026

Resolves #8219 for the dev-2.0 branch

This is the dev-2.0 port of #8555.

Summary

  • Adds a one-time confirmation prompt before tessellating very large PATH-mode shapes (>50,000 vertices) to avoid browser freezes in libtess.
  • Cancel: skips tessellation and draws nothing for that shape.
  • OK: remembers the choice for the lifetime of the renderer via _largeTessellationAcknowledged and tessellates normally without prompting again.
  • Respects p5.disableFriendlyErrors: when disabled, tessellation always runs with no prompt.

Tests

Added unit tests in test/unit/webgl/p5.RendererGL.js under the beginShape() in WEBGL mode suite, written in vitest syntax (vi.spyOn / mockImplementation). All 4 tests pass locally.

@Nixxx19
Copy link
Copy Markdown
Author

Nixxx19 commented Apr 17, 2026

Screenshot 2026-04-17 at 3 57 22 PM

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.

1 participant