Skip to content

[Impeller] Use 32-bit index values in the tessellator if the platform supports it#178088

Merged
auto-submit[bot] merged 4 commits into
flutter:masterfrom
jason-simmons:bug_175031
Nov 12, 2025
Merged

[Impeller] Use 32-bit index values in the tessellator if the platform supports it#178088
auto-submit[bot] merged 4 commits into
flutter:masterfrom
jason-simmons:bug_175031

Conversation

@jason-simmons

Copy link
Copy Markdown
Member

Applications may try to render paths whose point count exceeds the bounds of a 16-bit index. This PR changes the tessellator to use 32-bit indices when available but will fall back to 16-bit on platforms that do not support it (specifically OpenGL ES implementations without the necessary extension).

Fixes #175031
Fixes #178022

@github-actions github-actions Bot added engine flutter/engine related. See also e: labels. e: impeller Impeller rendering backend issues and features requests labels Nov 6, 2025

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for 32-bit index values in the tessellator for platforms that support it, addressing potential overflows with 16-bit indices for paths with a large number of points. The changes correctly add a new capability, Supports32BitPrimitiveIndices, and implement it for Vulkan and GLES backends. The Tessellator class is refactored to use a templated implementation that can be instantiated with either uint16_t or uint32_t for indices, based on the detected capability. This is a solid approach to handle the different index sizes. I have one suggestion to reduce code duplication in the new tessellator implementation.

Comment thread engine/src/flutter/impeller/tessellator/tessellator.cc Outdated
}

bool CapabilitiesVK::Supports32BitPrimitiveIndices() const {
return true;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems unnecessary as this is the default.

… supports it

Applications may try to render paths whose point count exceeds the bounds of
a 16-bit index.  This PR changes the tessellator to use 32-bit indices when
available but will fall back to 16-bit on platforms that do not support it
(specifically OpenGL ES implementations without the necessary extension).

Fixes flutter#175031
Fixes flutter#178022
@jason-simmons jason-simmons added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 12, 2025
@auto-submit auto-submit Bot added this pull request to the merge queue Nov 12, 2025
Merged via the queue into flutter:master with commit 9fed4d2 Nov 12, 2025
186 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 12, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 16, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 16, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 16, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 17, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 17, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 17, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 17, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 17, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 17, 2025
IvoneDjaja pushed a commit to IvoneDjaja/flutter that referenced this pull request Nov 22, 2025
… supports it (flutter#178088)

Applications may try to render paths whose point count exceeds the
bounds of a 16-bit index. This PR changes the tessellator to use 32-bit
indices when available but will fall back to 16-bit on platforms that do
not support it (specifically OpenGL ES implementations without the
necessary extension).

Fixes flutter#175031
Fixes flutter#178022
mboetger pushed a commit to mboetger/flutter that referenced this pull request Dec 2, 2025
… supports it (flutter#178088)

Applications may try to render paths whose point count exceeds the
bounds of a 16-bit index. This PR changes the tessellator to use 32-bit
indices when available but will fall back to 16-bit on platforms that do
not support it (specifically OpenGL ES implementations without the
necessary extension).

Fixes flutter#175031
Fixes flutter#178022
reidbaker pushed a commit to AbdeMohlbi/flutter that referenced this pull request Dec 10, 2025
… supports it (flutter#178088)

Applications may try to render paths whose point count exceeds the
bounds of a 16-bit index. This PR changes the tessellator to use 32-bit
indices when available but will fall back to 16-bit on platforms that do
not support it (specifically OpenGL ES implementations without the
necessary extension).

Fixes flutter#175031
Fixes flutter#178022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e: impeller Impeller rendering backend issues and features requests engine flutter/engine related. See also e: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unexpectedly start and end point get connected when drawing smooth curve paths on iOS platform flutter_svg rendering issue on iOS in landscape mode

2 participants