Skip to content

Fixes MSAA on the linux embedder. - #191379

Merged
robert-ancell merged 6 commits into
flutter:masterfrom
gaaclarke:fix-linux-msaa
Aug 23, 2026
Merged

robert-ancell merged 6 commits into
flutter:masterfrom
gaaclarke:fix-linux-msaa

Conversation

@gaaclarke

@gaaclarke gaaclarke commented Aug 19, 2026 •

Copy link
Copy Markdown
Member

fixes #191171

This is the linux equivalent of the windows change: #190256

On desktop we normally need to have an explicit resolution step for MSAA to work, this adds that explicit step. On linux we were already blitting from this framebuffer so we didn't need to provide an explicit resolve step, it already existed.

I also removed code about using bgra. This was impeding our usage of MSAA render buffers, on linux I don't think there is a reason we have to use BGRA.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

@gaaclarke gaaclarke added the CICD Run CI/CD label Aug 19, 2026
@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 Aug 19, 2026
@gaaclarke
gaaclarke marked this pull request as ready for review August 19, 2026 21:36
@gaaclarke
gaaclarke requested a review from a team as a code owner August 19, 2026 21:36

@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 adds support for configuring multisample anti-aliasing (MSAA) attachments in FlFramebuffer when Impeller is enabled on Linux, updating FlEngine to track the Impeller state and introducing corresponding unit tests. Feedback suggests resetting OpenGL resource IDs to 0 in fl_framebuffer_dispose to prevent potential double-deletion issues, and refactoring fl_framebuffer_new_multisample to eliminate duplicated fallback paths.

Comment thread engine/src/flutter/shell/platform/linux/fl_framebuffer.cc
Comment thread engine/src/flutter/shell/platform/linux/fl_framebuffer.cc Outdated
@gaaclarke
gaaclarke marked this pull request as draft August 19, 2026 21:44
@gaaclarke
gaaclarke marked this pull request as ready for review August 19, 2026 21:53

@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 adds support for implicit and offscreen Multisample Anti-Aliasing (MSAA) in the Flutter Linux embedder when Impeller is enabled, updating framebuffer creation and adding corresponding unit tests. The review feedback suggests simplifying the offscreen MSAA support check by targeting OpenGL 3.0+ directly, removing an unused parameter in attach_depth_stencil, and refactoring the MSAA configuration logic to reduce nesting and eliminate duplicate fallback code.

Comment thread engine/src/flutter/shell/platform/linux/fl_framebuffer.cc
Comment thread engine/src/flutter/shell/platform/linux/fl_framebuffer.cc Outdated
Comment thread engine/src/flutter/shell/platform/linux/fl_framebuffer.cc Outdated

@robert-ancell robert-ancell 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.

With a few changes should be good to land.

Comment thread engine/src/flutter/shell/platform/linux/fl_engine.cc Outdated
Comment thread engine/src/flutter/shell/platform/linux/fl_framebuffer.cc
Comment thread engine/src/flutter/shell/platform/linux/fl_framebuffer.h Outdated
Comment thread engine/src/flutter/shell/platform/linux/fl_engine.cc

@robert-ancell robert-ancell 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.

All good, thanks!

@robert-ancell
robert-ancell added this pull request to the merge queue Aug 23, 2026
Merged via the queue into flutter:master with commit 5f97c7f Aug 23, 2026
16 of 17 checks passed
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Aug 24, 2026
flutter/flutter@65c9a8d...9a82789

2026-08-24 [email protected] Roll Packages from 252bb33 to df2ba94 (5 revisions) (flutter/flutter#191578)
2026-08-24 [email protected] Roll Dart SDK from cb056da580b6 to 78bbc37b6ff6 (13 revisions) (flutter/flutter#191574)
2026-08-24 [email protected] Roll Skia from 50452b13f05b to 57968d087d18 (1 revision) (flutter/flutter#191572)
2026-08-24 [email protected] Move more RSE rendering cases to complex_rse.frag (flutter/flutter#191235)
2026-08-24 [email protected] Roll Skia from 925e13559532 to 50452b13f05b (2 revisions) (flutter/flutter#191570)
2026-08-24 [email protected] iOS: Add stylus pointer tests (flutter/flutter#191564)
2026-08-24 [email protected] iOS: Improve FlutterEngineGroup tests (flutter/flutter#191563)
2026-08-24 [email protected] Roll Skia from c78782c7c1c2 to 925e13559532 (5 revisions) (flutter/flutter#191568)
2026-08-24 [email protected] Roll Skia from 886302c7c68e to c78782c7c1c2 (1 revision) (flutter/flutter#191566)
2026-08-24 [email protected] Revert "Improve initial size and placement logic for popups and toolt…ips on Linux (#189994) (flutter/flutter#191498)
2026-08-23 [email protected] Roll Fuchsia Linux SDK from Cqs-NyeELd60hqv1e... to 8Xu4ujBJniC0nQGx3... (flutter/flutter#191561)
2026-08-23 [email protected] Fixes MSAA on the linux embedder. (flutter/flutter#191379)
2026-08-23 [email protected] Remove Material/Cupertino references in error messages (flutter/flutter#191305)
2026-08-23 [email protected] Roll Skia from a1825062f832 to 886302c7c68e (1 revision) (flutter/flutter#191559)
2026-08-23 [email protected] Roll Skia from ad2106c0bb64 to a1825062f832 (1 revision) (flutter/flutter#191555)
2026-08-22 [email protected] Roll Fuchsia Linux SDK from ic6GjOSn-KN508XyK... to Cqs-NyeELd60hqv1e... (flutter/flutter#191547)
2026-08-22 [email protected] [WebParagraph] Fixing minor problem with getBoxesForRange (flutter/flutter#191419)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
pull Bot pushed a commit to AbhiShake1/flutter that referenced this pull request Aug 28, 2026
FlViewRendererSubsurface is the default renderer on Wayland, so Flutter
apps running with Impeller on Mesa drivers currently show nothing but a
black window.

It picked its framebuffer format from
epoxy_has_gl_extension("GL_EXT_texture_format_BGRA8888"), which asks
what the driver is capable of rather than what the engine actually
rendered. The frame was composited into a BGRA framebuffer while the
engine had rendered RGBA, so nothing reached the screen. The failure is
silent: the framebuffer is complete, no GL errors are raised, and the
Wayland surface is committed as normal.

That check used to be correct, and was invalidated by 5f97c7f
("Fixes MSAA on the linux embedder", flutter#191379) in two ways:

- It replaced the identical check in fl_opengl_frame.cc with one that
reads the format the engine reported in the layer's backing store,
making the extension check the stale copy of a rule that had moved on.
- It made the engine render RGBA even where the extension is advertised.
With Impeller the backing store is now allocated by
fl_framebuffer_new_multisample(), whose offscreen MSAA path attaches a
multisample renderbuffer of GL_RGBA8 and no texture, and fl_engine.cc
reports GL_RGBA8 for those. Driver capability and rendered format are
therefore no longer the same question.

FlViewRendererSubsurface was written before that landed and merged
cleanly after it, in 706edcd ("Add FlViewRendererSubsurface",
flutter#191389), because the two changes touch different files and so never
conflicted textually.

Move the rule into fl_compositor_opengl_get_frame_format() and use it
from both paths so they cannot disagree again. fl_engine.cc remains the
only place that chooses a format; both consumers now follow what it
reports. Every backing store in a frame is created from context-wide
capabilities, so they all share a format, and the first one describes
the frame. Take it from the first backing store rather than the first
layer, as platform views carry no format and would otherwise decide it
by being drawn first.

The bug is not reachable from a unit test, as presenting a frame
requires a realized Wayland subsurface and the tests run on X11, so test
the shared function directly, including that an advertised extension
does not change its result.
jagadeesh8682 pushed a commit to jagadeesh8682/packages that referenced this pull request Sep 2, 2026
…r#12578)

flutter/flutter@65c9a8d...9a82789

2026-08-24 [email protected] Roll Packages from 252bb33 to df2ba94 (5 revisions) (flutter/flutter#191578)
2026-08-24 [email protected] Roll Dart SDK from cb056da580b6 to 78bbc37b6ff6 (13 revisions) (flutter/flutter#191574)
2026-08-24 [email protected] Roll Skia from 50452b13f05b to 57968d087d18 (1 revision) (flutter/flutter#191572)
2026-08-24 [email protected] Move more RSE rendering cases to complex_rse.frag (flutter/flutter#191235)
2026-08-24 [email protected] Roll Skia from 925e13559532 to 50452b13f05b (2 revisions) (flutter/flutter#191570)
2026-08-24 [email protected] iOS: Add stylus pointer tests (flutter/flutter#191564)
2026-08-24 [email protected] iOS: Improve FlutterEngineGroup tests (flutter/flutter#191563)
2026-08-24 [email protected] Roll Skia from c78782c7c1c2 to 925e13559532 (5 revisions) (flutter/flutter#191568)
2026-08-24 [email protected] Roll Skia from 886302c7c68e to c78782c7c1c2 (1 revision) (flutter/flutter#191566)
2026-08-24 [email protected] Revert "Improve initial size and placement logic for popups and toolt…ips on Linux (#189994) (flutter/flutter#191498)
2026-08-23 [email protected] Roll Fuchsia Linux SDK from Cqs-NyeELd60hqv1e... to 8Xu4ujBJniC0nQGx3... (flutter/flutter#191561)
2026-08-23 [email protected] Fixes MSAA on the linux embedder. (flutter/flutter#191379)
2026-08-23 [email protected] Remove Material/Cupertino references in error messages (flutter/flutter#191305)
2026-08-23 [email protected] Roll Skia from a1825062f832 to 886302c7c68e (1 revision) (flutter/flutter#191559)
2026-08-23 [email protected] Roll Skia from ad2106c0bb64 to a1825062f832 (1 revision) (flutter/flutter#191555)
2026-08-22 [email protected] Roll Fuchsia Linux SDK from ic6GjOSn-KN508XyK... to Cqs-NyeELd60hqv1e... (flutter/flutter#191547)
2026-08-22 [email protected] [WebParagraph] Fixing minor problem with getBoxesForRange (flutter/flutter#191419)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
mkanada pushed a commit to mkanada/zywny that referenced this pull request Sep 20, 2026
O app abre MEI/MusicXML, gera a cena em `.vsb` (Verovio Score Bridge) por
FFI num isolate e a desenha com o `ScenePainter` do score_bridge, em vez de
renderizar dotLottie.

- `third_party/verovio_lottie` -> `third_party/verovio_flutter_bridge`, que
  traz os pacotes `verovio` (bindings FFI do fork que exporta `.vsb`) e
  `score_bridge` (parser + pintor).
- `lib/verovio_render.dart`: renderiza a partitura inteira num isolate — o
  toolkit nativo é um ponteiro que não atravessa isolates — e valida o
  pacote antes de entregar ao parser.
- `lib/verovio_resources.dart`: as fontes de gravação viram um zip único
  (`assets/verovio_data.zip`, de `tool/build_verovio_assets.sh`) extraído na
  primeira execução, porque o bundler de assets do Flutter não recursa em
  diretórios.
- `lib/main.dart`: a página é engravada para a caixa medida em pixels de
  dispositivo, com zoom e navegação entre páginas.
- `test/vsb_render_test.dart`: integração MEI -> `.vsb` -> `ScenePainter`,
  pulada quando os artefatos não versionados estão ausentes.

Junto, um `justfile` com as tarefas do projeto. `just run` desliga o
Impeller: no Linux ele não resolve o MSAA e serrilha todo o vetorial, o que
numa partitura (path fino) é grosseiro — flutter/flutter#191171, corrigido
em master por flutter/flutter#191379, ainda fora do stable 3.47.4.

Co-Authored-By: Claude Opus 5 <[email protected]>
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.

Impeller on linux does not apply anti-aliasing to vector images

2 participants