Hash :
51386f4a
Author :
Date :
2019-04-11T21:55:20
Reland "Define and expose EGL_ANGLE_power_preference extension." This is a reland of ac58e63295f093b7518535bdd060ff832025b0c5 The original CL was reverted in a rush because I thought there was an uninitialized variable bug, but upon later re-review this turned out to not be the case. Original change's description: > Define and expose EGL_ANGLE_power_preference extension. > > Allows application to select the integrated or discrete GPU on > dual-GPU macOS systems. > > Tested by modifying the example program at: > https://github.com/grorg/ANGLEIOSurfaceTest > > and verifying that both integrated and discrete GPUs can be selected. > (The changes to that program will be upstreamed once some build issues > are resolved.) > > Bug: 2813 > Change-Id: Ibeb17778512896456d220e9bc4cf8f222aa57057 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1570081 > Commit-Queue: Kenneth Russell <kbr@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> Bug: 2813 Tbr: geofflang@chromium.org Tbr: cwallez@chromium.org Change-Id: Iea000dd718f4f4b4f57237adb1dc44381b10106b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1575419 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
The EGL headers ANGLE uses are generated using the Khronos tools but modified to include function pointer types and function prototype guards.
Install Python 3 (not 2) with the lxml addon. You can do this using pip install lxml from your Python’s Scripts folder.
Edit EGL-Registry/api/genheaders.py:
# EGL API - EGL/egl.h (no function pointers, yet @@@) genFuncPointers = False, to genFuncPointers = True, protectProto = False, to protectProto = 'nonzero', protectProtoStr = 'EGL_EGLEXT_PROTOTYPES', to protectProtoStr = 'EGL_EGL_PROTOTYPES',
Set your working directory to EGL-Registry/api/.
Run python genheaders.py -registry egl.xml EGL/egl.h
The generated header will now be in EGL-Registry/api/EGL/egl.h. You can copy the header over to this folder.
Also update scripts/egl.xml with the latest version from EGL-Registry/api/.