FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[Flutter GPU] Release builds on Linux and Windows cannot enable Flutter GPU · Issue #190871 · flutter/flutter · GitHub

[Flutter GPU] Release builds on Linux and Windows cannot enable Flutter GPU #190871

Description

Flutter GPU has a permanent, project-level opt-in on every platform except Linux and Windows. iOS and macOS use FLTEnableFlutterGPU in Info.plist, Android uses the io.flutter.embedding.android.EnableFlutterGPU manifest key. On Linux and Windows the only way to set it is the --enable-flutter-gpu engine switch.

Release desktop builds ignore engine switches from the environment. GetSwitchesFromEnvironment in shell/platform/common/engine_switches.cc is wrapped in #ifndef FLUTTER_RELEASE, so the switch reaches the engine only under flutter run. A packaged release app on Linux or Windows therefore has no way to turn Flutter GPU on.

Steps to reproduce

  1. Create an app that calls into package:flutter_gpu.
  2. flutter run -d windows --enable-flutter-gpu (or -d linux) and confirm it works.
  3. flutter build windows --release (or linux) and launch the packaged executable directly.

Expected results

Some supported way to enable Flutter GPU for the release build, matching the other platforms.

Actual results

The first Flutter GPU call throws.

Exception: Flutter GPU must be enabled via the Flutter GPU manifest setting. This can be done
either via command line argument --enable-flutter-gpu or by adding the FLTEnableFlutterGPU key
set to true on iOS or io.flutter.embedding.android.EnableFlutterGPU metadata key to true on
Android.

The message lists no desktop option, because none existed.

Notes

Related to #167734, which is the Windows half of this reported as a sample failure. The most recent comment there describes the same packaging problem.

Fixed on master by #190684, which adds fl_dart_project_set_enable_flutter_gpu on Linux and DartProject::set_enable_flutter_gpu on Windows.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: desktopRunning on desktopengineflutter/engine related. See also e: labels.flutter-gpuplatform-linuxBuilding on or for Linux specificallyplatform-windowsBuilding on or for Windows specificallyteam-fluttergpuOwned by Flutter GPU team

    Type

    No type

    Projects

    • Status
      🤔 Needs Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL