Skip to content

add sdf golden variants for OpenGL#187246

Merged
auto-submit[bot] merged 5 commits into
flutter:masterfrom
walley892:sdf-tests
May 30, 2026
Merged

add sdf golden variants for OpenGL#187246
auto-submit[bot] merged 5 commits into
flutter:masterfrom
walley892:sdf-tests

Conversation

@walley892
Copy link
Copy Markdown
Contributor

@walley892 walley892 commented May 28, 2026

Adds SDF variants for OpenGL golden tests

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label May 28, 2026
@github-actions github-actions Bot added engine flutter/engine related. See also e: labels. e: impeller Impeller rendering backend issues and features requests labels May 28, 2026
@walley892 walley892 requested a review from gaaclarke May 28, 2026 17:33
Copy link
Copy Markdown
Contributor

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

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 the kOpenGLESSDF and kVulkanSDF playground backends to Impeller, enabling SDF-based rendering tests for OpenGLES and Vulkan. The changes update backend string conversions, support checks, playground creation logic, and unit tests to handle these new backends. The reviewer suggests simplifying the playground creation logic in playground_impl.cc by grouping the SDF and non-SDF cases for both OpenGLES and Vulkan using [[fallthrough]] to avoid code duplication.

Comment thread engine/src/flutter/impeller/playground/playground_impl.cc
Comment on lines +52 to +60
case PlaygroundBackend::kVulkanSDF:
if (!PlaygroundImplVK::IsVulkanDriverPresent()) {
FML_CHECK(false) << "Attempted to create playground with backend that "
"isn't available or was disabled on this platform: "
<< PlaygroundBackendToString(backend);
}
switches.flags.use_sdfs = true;
switches.enable_vulkan_validation = true;
return std::make_unique<PlaygroundImplVK>(switches);
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.

medium

Similarly to the OpenGL case, we can avoid duplicating the driver check, validation flag setup, and PlaygroundImplVK creation by placing case PlaygroundBackend::kVulkanSDF: before case PlaygroundBackend::kVulkan: and using [[fallthrough]].

Since case PlaygroundBackend::kVulkan: is outside the current diff hunk, a direct code suggestion cannot be applied here, but please consider manually refactoring it like so:

    case PlaygroundBackend::kVulkanSDF:
      switches.flags.use_sdfs = true;
      [[fallthrough]];
    case PlaygroundBackend::kVulkan:
      if (!PlaygroundImplVK::IsVulkanDriverPresent()) {
        FML_CHECK(false) << "Attempted to create playground with backend that "
                            "isn't available or was disabled on this platform: "
                         << PlaygroundBackendToString(backend);
      }
      switches.enable_vulkan_validation = true;
      return std::make_unique<PlaygroundImplVK>(switches);
References
  1. Suggest simplification and refactoring: Assess whether the code can be made simpler or refactored to enhance readability and maintainability. (link)

Copy link
Copy Markdown
Member

@gaaclarke gaaclarke left a comment

Choose a reason for hiding this comment

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

Let's not land this until #187243 lands.

The OpenGLES tests are super slow and people are already complaining about CI time. Can we also just add OpenGLES for now since no one should be using the vulkansdf backend?

@github-actions github-actions Bot removed the CICD Run CI/CD label May 28, 2026
@walley892 walley892 changed the title add sdf golden variants for vulkan and opengl add sdf golden variants for vulkan May 28, 2026
@walley892 walley892 changed the title add sdf golden variants for vulkan add sdf golden variants for OpenGL May 28, 2026
Copy link
Copy Markdown
Member

@gaaclarke gaaclarke left a comment

Choose a reason for hiding this comment

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

#187243 landed, can you rebase against that please?

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label May 29, 2026
@walley892 walley892 requested a review from gaaclarke May 29, 2026 22:03
gaaclarke
gaaclarke previously approved these changes May 29, 2026
Copy link
Copy Markdown
Member

@gaaclarke gaaclarke left a comment

Choose a reason for hiding this comment

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

okay, let's give this a shot

@walley892 walley892 added the autosubmit Merge PR when tree becomes green via auto submit App label May 29, 2026
@auto-submit
Copy link
Copy Markdown
Contributor

auto-submit Bot commented May 29, 2026

autosubmit label was removed for flutter/flutter/187246, because - The status or check suite Flutter Presubmits has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label May 29, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label May 29, 2026
@walley892 walley892 requested a review from gaaclarke May 29, 2026 23:59
@walley892 walley892 added CICD Run CI/CD autosubmit Merge PR when tree becomes green via auto submit App labels May 30, 2026
@auto-submit auto-submit Bot added this pull request to the merge queue May 30, 2026
Merged via the queue into flutter:master with commit b4e5291 May 30, 2026
23 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label May 30, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Jun 1, 2026
flutter/flutter@b05a9d7...54e199a

2026-06-01 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from jMR_VXQi07kAk8vbR... to q27k7_um1GvVrySZS... (flutter/flutter#187338)
2026-06-01 rmacnak@google.com Remove use of deprecated API related to removal of the VM isolate. (flutter/flutter#187013)
2026-06-01 116356835+AbdeMohlbi@users.noreply.github.com Improve `dependOnInheritedWidgetOfExactType` documentation to explain why it is bad to use it in initState (flutter/flutter#186216)
2026-06-01 chris@bracken.jp Revert "Move dart-lang/ai to a top level third party dependency in en… (flutter/flutter#187370)
2026-05-30 jakemac@google.com Move dart-lang/ai to a top level third party dependency in engine (flutter/flutter#187268)
2026-05-30 evanwall@buffalo.edu add sdf golden variants for OpenGL (flutter/flutter#187246)
2026-05-30 engine-flutter-autoroll@skia.org Roll Skia from dc01525ac468 to 0aee4675e0ad (6 revisions) (flutter/flutter#187334)
2026-05-29 engine-flutter-autoroll@skia.org Roll Skia from c480ba2eb2eb to dc01525ac468 (4 revisions) (flutter/flutter#187317)
2026-05-29 jason-simmons@users.noreply.github.com Remove the Y coordinate flip workaround in the Material stretch effect shader now that it is no longer required by the Impeller GLES back end (flutter/flutter#187247)
2026-05-29 bkonyi@google.com [flutter_tools, devicelab] Fix filesystem safety guard for symlinked temp directories (flutter/flutter#187320)
2026-05-29 30870216+gaaclarke@users.noreply.github.com Brings linux tests out of bringup. (flutter/flutter#187271)
2026-05-29 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#187321)
2026-05-29 engine-flutter-autoroll@skia.org Roll Fuchsia GN SDK from SEfYx3xgueX3aFAY3... to oOAcFhkoE2_-Sy67z... (flutter/flutter#187310)
2026-05-29 36861262+QuncCccccc@users.noreply.github.com Fix mismatch between hit-test tree and traversal tree (flutter/flutter#186826)
2026-05-29 jason-simmons@users.noreply.github.com [Impeller] Ensure that the TextureGLES destructor cleans up all objects that it holds including the sync fence (flutter/flutter#187216)
2026-05-29 engine-flutter-autoroll@skia.org Roll Packages from 10cbdc5 to e930ced (3 revisions) (flutter/flutter#187306)
2026-05-29 engine-flutter-autoroll@skia.org Roll Skia from d9d6b440c4e7 to c480ba2eb2eb (1 revision) (flutter/flutter#187305)

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 stuartmorgan@google.com,tarrinneal@google.com 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
bdero added a commit to bdero/flutter that referenced this pull request Jun 2, 2026
flutter#187246 added a kOpenGLESSDF variant to PlaygroundBackend after this
PR's CI had last run. CanRenderToMipLevel only skipped kOpenGLES, so it
ran on kOpenGLESSDF and aborted because the GLES test backend does not
support rendering into non-zero mip levels. Match the skip pattern that
every other GLES-skipping test in this file already uses.
pull Bot pushed a commit to g-star1024/flutter that referenced this pull request Jun 3, 2026
…ices (flutter#187470)

Relands flutter#187066, reverted in flutter#187445.

The original PR passed every pre-submit check and merged cleanly, but
broke post-submit on Mac and Linux because a concurrent change (flutter#187246,
`b4e5291940c` "add sdf golden variants for OpenGL") added a
`kOpenGLESSDF` variant to `PlaygroundBackend` that was not present when
this PR's CI last ran. `CanRenderToMipLevel` only skipped `kOpenGLES`,
so on the post-submit master it ran on `kOpenGLESSDF` and aborted with
SIGABRT because the GLES test backend does not support rendering into
non-zero mip levels. This reland is identical to flutter#187066 plus the
missing `kOpenGLESSDF` skip in `CanRenderToMipLevel`, matching the skip
pattern that every other GLES-skipping test in `renderer_unittests.cc`
already uses after flutter#187246.

Failing test seen post-submit (Mac mac_unopt build 12910, Linux
linux_unopt build 18302):
`Play/RendererTest.CanRenderToMipLevel/OpenGLESSDF` returned/aborted
with exit code -6.

---

Fixes flutter#145014 (the attachment half; uploading specific
mip levels and slices already landed).

Impeller could only attach the base mip level and slice of a texture as
a render target. This adds `mip_level` and `slice` to the HAL
`Attachment` struct so a render pass can target a specific mip level,
cube map face, or array layer. The render target size follows the
selected mip level.

- Metal: sets the attachment descriptor's level and slice.
- Vulkan: creates one 2D attachment view per mip level and layer, and
the framebuffer cache is keyed on `(sample_count, mip_level, slice)` so
non-base subresources reuse cached framebuffers.
- OpenGL ES: attaches the cube face target and mip level, allocates the
subresource on demand, and gates non-zero mip levels on ES 3.0 or
`GL_OES_fbo_render_mipmap`. Rendering to cube faces works down to ES
2.0.

Tests cover attachment validation and cross-backend rendering to a slice
and to a mip level.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[AI contribution guidelines]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD 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.

2 participants