Hash :
af727792
Author :
Date :
2020-06-10T21:55:43
Improve EGL_ANGLE_power_preference on dual-GPU MacBook Pros. Add the ability to release and reacquire the high-power GPU, and to respond to changes in the active GPU. In Chromium, the GPU process can not access the WindowServer. An external process must inform ANGLE that the active GPU has changed, and that ANGLE should switch its internal context to the new GPU. Incorporates a couple of functions from WebKit, used with permission, to effect this GPU switch. A follow-on change in Chromium which uses these new APIs will make the existing dual-GPU tests pass with ANGLE and the passthrough command decoder. Carry forward Chromium's workaround of disabling GPU switching on older MacBook Pros to ensure stability. Document the process of adding new EGL extensions to ANGLE. Bug: chromium:1091824 Change-Id: I499739156e851b493555d4d6e4aef87d8b97fa31 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2240638 Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
This page describes how to add new extensions to ANGLE.
Note: see also anglebug.com/2621, linked from the starter project doc, to simplify some of these steps.
For extensions requiring new entry points:
Add the extension xml to this file: https://source.chromium.org/chromium/chromium/src/+/master:third_party/angle/scripts/egl_angle_ext.xml
Note the prototypes for the new entry points must be added to the top of the file, and the functions themselves grouped under the extension name to the bottom of the file.
Modify scripts/registry_xml.py to add the new extension as needed.
The entry point itself goes in the entry_points_egl_ext.h and cpp files.
Update eglext_angle.h with the new entry points and/or enums.
Add members to the appropriate Extensions struct in Caps.h
Initialize extension availability in the Display subclass’s
generateExtensions method for displays that can support the extension.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
# Introduction
This page describes how to add new extensions to ANGLE.
# Adding EGL extensions
Note: see also [anglebug.com/2621](http://anglebug.com/2621), linked
from the [starter project](Starter-Projects.md) doc, to simplify some
of these steps.
For extensions requiring new entry points:
* Add the extension xml to this file:
https://source.chromium.org/chromium/chromium/src/+/master:third_party/angle/scripts/egl_angle_ext.xml
* Note the prototypes for the new entry points must be added to the
top of the file, and the functions themselves grouped under the
extension name to the bottom of the file.
* Modify `scripts/registry_xml.py` to add the new extension as needed.
* run
[scripts/run_code_generation.py](https://source.chromium.org/chromium/chromium/src/+/master:third_party/angle/scripts/run_code_generation.py)
* The entry point itself goes in the
[entry_points_egl_ext.h](https://source.chromium.org/chromium/chromium/src/+/master:third_party/angle/src/libGLESv2/entry_points_egl_ext.h)
and cpp files.
* Update
[eglext_angle.h](https://source.chromium.org/chromium/chromium/src/+/master:third_party/angle/include/EGL/eglext_angle.h)
with the new entry points and/or enums.
* Add members to the appropriate Extensions struct in
[Caps.h](https://source.chromium.org/chromium/chromium/src/+/master:third_party/angle/src/libANGLE/Caps.h)
* Initialize extension availability in the `Display` subclass's
`generateExtensions` method for displays that can support the extension.