#opengl-es #google #angle #github #fork #gn

mozangle

Mozilla’s fork of Google ANGLE, repackaged as a Rust crate

20 releases

Uses old Rust 2015

0.3.3 Mar 10, 2021
0.3.2 Dec 1, 2020
0.3.1 Sep 13, 2019
0.2.3 Jul 12, 2019
0.1.6 Mar 15, 2018

#167 in Graphics APIs

Download history 575/week @ 2022-06-12 605/week @ 2022-06-19 567/week @ 2022-06-26 543/week @ 2022-07-03 541/week @ 2022-07-10 537/week @ 2022-07-17 537/week @ 2022-07-24 568/week @ 2022-07-31 549/week @ 2022-08-07 767/week @ 2022-08-14 743/week @ 2022-08-21 419/week @ 2022-08-28 265/week @ 2022-09-04 274/week @ 2022-09-11 315/week @ 2022-09-18 294/week @ 2022-09-25

1,192 downloads per month
Used in 4 crates

BSD-3-Clause

9.5MB
226K SLoC

C++ 220K SLoC // 0.0% comments Rust 3K SLoC // 0.0% comments Happy 2K SLoC C 1K SLoC // 0.2% comments Python 522 SLoC // 0.2% comments Shell 11 SLoC

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/angle in mozilla-central is generated from that. update-angle.py runs gn desc to extract information from the official build system, copies relevant source files, and creates moz.build files for Gecko’s build system.

  • This repository imports a copy of the gfx/angle directory. The generate_build_data.py script turns data from moz.build files into a Rust source file. (This script supports just enough of the moz.build format 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.

In Windows, the egl Cargo feature enables the EGL and OpenGL ES implementations. Although upstream ANGLE supports more platforms, this crate only configures the Direct3D 11 rendering backend.

[dependencies]
mozangle = { version = "0.2", features = ["egl"] }

Updating ANGLE

To update:

  • Remove gfx/angle entirely
  • Copy a new version of it from mozilla-central
  • Apply any patches present in the patches directory
  • Run python3 generate_build_data.py
  • In the commit message, include the mozilla-central commit hash.

Dependencies