Repository navigation
[Linux] Make glBlitFramebuffer optional in the OpenGL compositor - #189476
Merged
robert-ancell merged 2 commits intoAug 19, 2026
Merged
Conversation
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
Contributor
There was a problem hiding this comment.
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.
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.
This was referenced Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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