mozangle
Mozilla’s fork of Google ANGLE, repackaged as a Rust crate.
-
ANGLE is an implementation of OpenGL ES. Its official build system is
gn, from Chromium’s depot_tools. -
mozilla/angle on GitHub is a fork with some Gecko-specific patches.
-
gfx/anglein mozilla-central is generated from that.update-angle.pyrunsgn descto extract information from the official build system, copies relevant source files, and createsmoz.buildfiles for Gecko’s build system. -
This repository imports a copy of the
gfx/angledirectory. Thegenerate_build_data.pyscript turns data frommoz.buildfiles into a Rust source file. (This script supports just enough of themoz.buildformat for this specific purpose.) Finally, a Cargo build script drives the C++ compilation with the cc crate based on that data.
Feature flags
By default, this crate only compiles the shader translator. This should be cross-platform, and can be used with:
[]
= { = "https://github.com/servo/mozangle"}
The egl Cargo feature enables the EGL and OpenGL ES implementations.
This is only supported on Windows, since the Direct3D 11 rendering backend is configured.
[]
= { = "https://github.com/servo/mozangle", = ["egl"]}
Updating ANGLE
To update:
- Remove
gfx/angleentirely - Copy a new version of it from mozilla-central
- Run
python3 generate_build_data.py - In the commit message, include the mozilla-central commit hash.