mirror of
https://github.com/utmapp/angle.git
synced 2026-12-06 02:12:05 -10:00
This is a reland of ac58e63295
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 <[email protected]>
> Reviewed-by: Geoff Lang <[email protected]>
Bug: 2813
Tbr: [email protected]
Tbr: [email protected]
Change-Id: Iea000dd718f4f4b4f57237adb1dc44381b10106b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1575419
Reviewed-by: Kenneth Russell <[email protected]>
Commit-Queue: Kenneth Russell <[email protected]>
ANGLE EGL Headers
The EGL headers ANGLE uses are generated using the Khronos tools but modified to include function pointer types and function prototype guards.
Regenerating EGL.h
-
Install Python 3 (not 2) with the lxml addon. You can do this using
pip install lxmlfrom your Python's Scripts folder. -
Edit
EGL-Registry/api/genheaders.py:- Look for the section titled
# EGL API - EGL/egl.h (no function pointers, yet @@@) - Change
genFuncPointers = False,togenFuncPointers = True, - Change
protectProto = False,toprotectProto = 'nonzero', - Change
protectProtoStr = 'EGL_EGLEXT_PROTOTYPES',toprotectProtoStr = 'EGL_EGL_PROTOTYPES',
- Look for the section titled
-
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.xmlwith the latest version fromEGL-Registry/api/.