Skip to content

[Linux] Make glBlitFramebuffer optional in the OpenGL compositor - #189476

Merged
robert-ancell merged 2 commits into
flutter:masterfrom
robert-ancell:make-glblitframebuffer-optional
Aug 19, 2026
Merged

robert-ancell merged 2 commits into
flutter:masterfrom
robert-ancell:make-glblitframebuffer-optional

Conversation

@robert-ancell

Copy link
Copy Markdown
Contributor

glBlitFramebuffer is a GLES3 / OpenGL 3.0 function and is not guaranteed to be present, so the Linux embedder should treat it as optional. The compositor was calling it unconditionally to blit the first layer, which breaks on OpenGL 2.0 drivers without the GL_EXT_framebuffer_blit extension and on drivers with a broken implementation (NVIDIA, Vivante, ARM per #152099).

Restore the blit-availability detection (GL version >= 3.0 or the GL_EXT_framebuffer_blit extension, plus the driver blacklist) and fall back to shader-based compositing for the first layer when blit is unavailable.

This regressed in e983e59 ("Perform OpenGL compositing in the Flutter thread and write to a framebuffer." #172090), which consolidated compositing and dropped the has_gl_framebuffer_blit check.

Strengthen the NoBlitFramebuffer and BlitFramebufferNvidia tests to assert glBlitFramebuffer is never called.

Fixes #189322

glBlitFramebuffer is a GLES3 / OpenGL 3.0 function and is not guaranteed
to be present, so the Linux embedder should treat it as optional. The
compositor was calling it unconditionally to blit the first layer, which
breaks on OpenGL 2.0 drivers without the GL_EXT_framebuffer_blit
extension and on drivers with a broken implementation (NVIDIA, Vivante,
ARM per flutter#152099).

Restore the blit-availability detection (GL version >= 3.0 or the
GL_EXT_framebuffer_blit extension, plus the driver blacklist) and fall
back to shader-based compositing for the first layer when blit is
unavailable.

This regressed in e983e59 ("Perform
OpenGL compositing in the Flutter thread and write to a framebuffer."
flutter#172090), which consolidated compositing and dropped the
has_gl_framebuffer_blit check.

Strengthen the NoBlitFramebuffer and BlitFramebufferNvidia tests to
assert glBlitFramebuffer is never called.

Fixes flutter#189322
@robert-ancell
robert-ancell requested a review from a team as a code owner July 14, 2026 22:14
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jul 14, 2026

@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 a check to determine if the OpenGL driver supports glBlitFramebuffer (excluding certain vendors like Vivante, ARM, and NVIDIA) and falls back to shader-based compositing if unsupported or unavailable. Corresponding tests are updated to verify that glBlitFramebuffer is not called under these conditions. The reviewer suggests caching the result of can_blit_framebuffer() in the FlCompositorOpenGL instance to avoid the overhead of querying the driver vendor and performing string matching on every frame.

Comment thread engine/src/flutter/shell/platform/linux/fl_compositor_opengl.cc
@github-actions github-actions Bot added engine flutter/engine related. See also e: labels. platform-linux Building on or for Linux specifically a: desktop Running on desktop team-linux Owned by the Linux platform team labels Jul 14, 2026
Compute whether glBlitFramebuffer can be used once during
fl_compositor_opengl_new and store the result in the compositor, instead
of re-evaluating it on every frame in
fl_compositor_opengl_composite_layers.

Construct the compositor in each test after configuring the mocked
OpenGL version/vendor/extensions so the cached value reflects the
scenario under test.

@loic-sharma loic-sharma left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good!

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

Labels

a: desktop Running on desktop CICD Run CI/CD engine flutter/engine related. See also e: labels. platform-linux Building on or for Linux specifically team-linux Owned by the Linux platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

linux App crashes on VMware with 'No provider of glBlitFramebuffer found' since Flutter 3.44

2 participants