Flutter GPU
Flutter GPU (previously referred to as "Dart GPU" or "Impeller Dart") is an effort to expose a low level graphics API in the Flutter Framework.
Design doc: https://flutter.dev/go/impeller-dart
Flutter GPU's runtime is a thin wrapper over Impeller's HAL, from which custom renderers may be entirely built using Dart. Just like with Impeller, Flutter GPU shader bundles are compiled ahead of time using impellerc. As such, Flutter GPU is only available on platforms that support Impeller.
Under the hood, the API communicates with Flutter Engine via Dart FFI, calling symbols publicly exported by libflutter and/or embedders. These symbols are prefixed with InternalFlutterGpu
, and are considered unstable. Direct usage of the exported symbols is not supported and will break without notice; the only supported way to use Flutter GPU is by importing package:flutter_gpu
.
Once released, Flutter GPU will be shipped as part of the Flutter SDK in the form of a Dart package called flutter_gpu
. An early implementation of the flutter_gpu
package is being developed under the lib/gpu
directory of the Flutter Engine repository.
Caution
All aspects of Flutter GPU are subject to breakage or removal at any time without prior deprecation notice or viable feature replacement. DO NOT rely on Flutter GPU for production projects at this time, but DO have fun playing with it and sharing your experiments with the community.
Flutter GPU is currently unfinished, extremely experimental, and not well documented. bdero is actively developing and testing Flutter GPU against the MacOS desktop embedder; shader compilation and import likely don't function correctly on other platforms yet. However, if you wish to experiment with Flutter GPU, it is possible to do so without a custom Engine build:
- Update your Flutter checkout to the latest version in the master channel.
- Clone Flutter Engine and checkout the Engine commit that the Flutter master channel is currently pinned to. This can be found in the
bin/internal/engine.version
file of the main Flutter repository.git clone https://github.com/flutter/engine.git cd engine git reset --hard [PINNED_ENGINE_COMMIT]
- Create a new Flutter project using the Flutter tool and add
flutter_gpu
as a dependency inpubspec.yaml
with a local path pointing to thelib/gpu
directory within the Flutter Engine repository cloned in step 2. For example:dependencies: flutter: sdk: flutter flutter_gpu: path: ../engine/src/flutter/lib/gpu
- From here, you can import the API and begin using it.
Check out this examples repository, which includes an example of drawing a triangle, among other things.
import 'package:flutter_gpu/gpu.dart' as gpu;
If you run into issues while using Flutter GPU, please file a bug using the standard bug report template. Additionally, mention "Flutter GPU" in the title, label the bug with the e: impeller
label, and tag bdero in the issue description.
If you have non-bug report questions surrounding Flutter GPU, there are several ways you can reach out to the developer:
- Create a thread in the #help channel of the Discord server. Place "Flutter GPU" in the title of the thread and tag @bdero in the message.
- Send a Twitter DM to @algebrandon.
- Home of the Wiki
- Roadmap
- API Reference (stable)
- API Reference (main)
- Glossary
- Contributor Guide
- Chat on Discord
- Design documents
- Code of Conduct
- Issue triage reports (latest)
- Our Values
- Tree hygiene
- Issue hygiene and Triage
- Style guide for Flutter repo
- Project teams
- Contributor access
- What should I work on?
- Popular issues
- Running and writing tests
- Release process
- Flutter Framework Gardener Rotation
- Rolling Dart
- Manual Engine Roll with Breaking Commits
- Updating Material Design Fonts & Icons
- Postmortems and Retrospectives
- Hotfix Documentation Best Practices
- In case of emergency
- Landing Changes With Autosubmit
- Setting up the Framework development environment
- The Framework architecture
- API Docs code block generation
- Running examples
- Using the Dart analyzer
- The flutter run variants
- Test coverage for package:flutter
- Writing a golden-file test for package:flutter
- Managing template image assets
- Setting up the Engine development environment
- Compiling the engine
- Debugging the engine
- Using Sanitizers with the Flutter Engine
- Testing the engine
- The Engine architecture
- Flutter's modes
- Crashes
- more...
- Setting up the Packages development environment
- Plugins and Packages repository structure
- Contributing to Plugins and Packages
- Understanding Packages tests
- Plugin Tests
- Releasing a Plugin or Package
- more...