-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android] update fallback and rendering state to combine impeller + android backend. #51008
Conversation
/*enable_vulkan_gpu_tracing=*/false, | ||
/*quiet=*/true); | ||
if (!vulkan_backend->IsValid()) { | ||
return AndroidRenderingAPI::kImpellerOpenGLES; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can implement ImpellerVulkan -> Skia fallback by changing this value (or adding another configuration setting).
"software rendering or disable impeller."; | ||
return AndroidRenderingAPI::kSoftware; | ||
} | ||
// Debug/Profile only functionality for testing a specific |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should fault instead of falling back on releases? Let's ask the team.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is awesome
@chinmaygarde Can you review this as well? Thanks! |
fml/message_loop.h
Outdated
@@ -27,7 +27,6 @@ class MessageLoopImpl; | |||
/// \see fml::Wakeable | |||
class MessageLoop { | |||
public: | |||
FML_EMBEDDER_ONLY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chinmaygarde not sure what to do here. This macro is flagging usages of this API in flutter_main.cc, it looks like those hadn't been touched in a while. Is there an alternatie usage of this API I can switch to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the GetCurrent
cannot be supported in all configurations because the thread or embedder may not have the ability to fetch the thread local task runner and instead must already have a handle to its task runner. So this is warning (via deprecation tags) that the API may only be used on embedder that have known safe access to the TLS message loop.
If the embedder knows that it is safe to access the TLS message loop slot, it can #define FML_USED_ON_EMBEDDER
to make this available. flutter_main.cc
should already have this and you shouldn't have to mess with this here.
Ideally, we should get rid of GetCurrent altogether but that is a migration.
@@ -22,6 +22,14 @@ | |||
|
|||
namespace flutter { | |||
|
|||
// The combination of targeted graphics API and Impeller support. | |||
enum class AndroidRenderingAPI { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Android"RenderingAPI going in common is unfortunate. I suppose no more so that common itself. Couldn't this go in //flutter/shell/common
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not unless common/settings.h can import flutter/common.
fml/message_loop.h
Outdated
@@ -27,7 +27,6 @@ class MessageLoopImpl; | |||
/// \see fml::Wakeable | |||
class MessageLoop { | |||
public: | |||
FML_EMBEDDER_ONLY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the GetCurrent
cannot be supported in all configurations because the thread or embedder may not have the ability to fetch the thread local task runner and instead must already have a handle to its task runner. So this is warning (via deprecation tags) that the API may only be used on embedder that have known safe access to the TLS message loop.
If the embedder knows that it is safe to access the TLS message loop slot, it can #define FML_USED_ON_EMBEDDER
to make this available. flutter_main.cc
should already have this and you shouldn't have to mess with this here.
Ideally, we should get rid of GetCurrent altogether but that is a migration.
@@ -2,6 +2,8 @@ | |||
// Use of this source code is governed by a BSD-style license that can be | |||
// found in the LICENSE file. | |||
|
|||
#include "common/settings.h" | |||
#include "impeller/base/validation.h" | |||
#define FML_USED_ON_EMBEDDER |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jonahwilliams You are running into the message loop error above because this define is not at the top.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦 Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While you are at it, https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes for the include order. These includes would go below the related header.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
78a4084
to
ed8e432
Compare
Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change). If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review. |
Golden file changes are available for triage from new commit, Click here to view. |
I wonder if this change is breaking how the scenario tests choose their backend. The golden diffs are mysterious to me, since its only off by a little bit |
rerunning a few times to see if its just flakey |
seems like it was just a flake, landing this. |
…peller + android backend. (flutter/engine#51008)
…peller + android backend. (flutter/engine#51008)
…peller + android backend. (flutter/engine#51008)
…144338) flutter/engine@91898e3...c9381fb 2024-02-28 dnfield@google.com Revert "Bump everything to Android 21" (flutter/engine#51056) 2024-02-28 skia-flutter-autoroll@skia.org Roll Skia from 0c294ee206e8 to 93f245da0097 (2 revisions) (flutter/engine#51055) 2024-02-28 jonahwilliams@google.com [Android] update fallback and rendering state to combine impeller + android backend. (flutter/engine#51008) 2024-02-28 bdero@google.com [Impeller] Fix GL depth state. (flutter/engine#51040) 2024-02-28 chris@bracken.jp Roll buildroot to 7b537de78ac2239982ace130d1845374e5dcf113 (flutter/engine#51053) 2024-02-28 skia-flutter-autoroll@skia.org Roll Skia from d935943bedcd to 0c294ee206e8 (3 revisions) (flutter/engine#51051) 2024-02-28 zanderso@users.noreply.github.com When run_tests.py is in --quiet mode, write verbose logs to a file (flutter/engine#51029) 2024-02-28 skia-flutter-autoroll@skia.org Roll Skia from fe34002ee826 to d935943bedcd (1 revision) (flutter/engine#51049) 2024-02-28 dnfield@google.com Bump everything to Android 21 (flutter/engine#51032) 2024-02-28 jiahaog@users.noreply.github.com Add flutter prefix to import (flutter/engine#51042) 2024-02-28 skia-flutter-autoroll@skia.org Roll Skia from d591703635b0 to fe34002ee826 (1 revision) (flutter/engine#51048) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC aaclarke@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: 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
AndroidRenderingAPI
to encapsulate Impeller/Skia config flutter#137798Combines AndroidRenderingAPI + enable_impeller into a 4 values enum that describes all combinations of rendering behavior: ImpellerVulkan, ImpellerOpenGLES, SkiaOpenGLES, Software.
Updates the fallback behavior to happen in flutter_main. This allows us to change the value of Settings.enable_impeller to support an Impeller -> Skia fallback.